Sha256: 2d20b2e909c10fcff269c9192de925301d3724666801402112c587a8a5efc6a1

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 Bytes

Contents

require "spec_helper"

describe HighVoltage::Constraints::RootRoute do
  describe "#matches?" do
    it "returns true when the view file exists" do
      request = double(path: "exists")

      result = described_class.new.matches?(request)

      expect(result).to be true
    end

    it "returns true when the view file exists and url ends with .html" do
      request = double(path: "exists.html")

      result = described_class.new.matches?(request)

      expect(result).to be true
    end

    it "returns false when the view files does not exist" do
      request = double(path: "index")

      result = described_class.new.matches?(request)

      expect(result).to be false
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
high_voltage-3.1.1 spec/constraints/root_route_spec.rb
high_voltage-3.1.0 spec/constraints/root_route_spec.rb