Sha256: ea55208758bdb8a9fba0d48de4e60791faa67c0ddea70696fcfd9973b59e1de4

Contents?: true

Size: 576 Bytes

Versions: 3

Compression:

Stored size: 576 Bytes

Contents

require 'spec_helper'

describe HighVoltage::Constraints::RootRoute, '.matches?' do
  context 'view file exists' do
    it 'should return true' do
      request = stub(:path => 'index')
      Dir.stub!(:glob).and_return(['about.html.erb'])

      HighVoltage::Constraints::RootRoute.matches?(request).should be_true
    end
  end

  context 'view file does not exist' do
    it 'should return false' do
      request = stub(:path => 'index')
      File.stub!(:glob).and_return([])

      HighVoltage::Constraints::RootRoute.matches?(request).should be_false
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
high_voltage-1.2.3 spec/constraints/root_route_spec.rb
high_voltage-1.2.2 spec/constraints/root_route_spec.rb
high_voltage-1.2.1 spec/constraints/root_route_spec.rb