Sha256: 6f5a1b33b6c2cf1832f1f6ead2c2310bc4066c47cc43d48d6f2797cddc909350

Contents?: true

Size: 567 Bytes

Versions: 2

Compression:

Stored size: 567 Bytes

Contents

require 'spec_helper'

describe HighVoltage::Constraints::RootRoute, '.matches?' do
  it 'returns true when the view file exists' 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

  it 'returns false when the view files does not exist' do
    request = double(path: 'index')
    File.stub(:glob).and_return([])

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

    expect(result).to be_false
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
high_voltage-2.2.1 spec/constraints/root_route_spec.rb
high_voltage-2.2.0 spec/constraints/root_route_spec.rb