Sha256: ee1eca468cfa2da0e6389cd3aec784ac0a6f91dc18d76e0fbe40a0d7f3519e3e

Contents?: true

Size: 626 Bytes

Versions: 3

Compression:

Stored size: 626 Bytes

Contents

require 'spec_helper'

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

      result = HighVoltage::Constraints::RootRoute.matches?(request)

      expect(result).to be_true
    end
  end

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

      result = HighVoltage::Constraints::RootRoute.matches?(request)

      expect(result).to be_false
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
high_voltage-2.1.0 spec/constraints/root_route_spec.rb
high_voltage-2.0.0 spec/constraints/root_route_spec.rb
high_voltage-1.2.4 spec/constraints/root_route_spec.rb