Sha256: e08be23f5c58de7dde53c43b55c37932f7b072a05ffe341aad2abc70546c6cc9

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'

RSpec.describe Thesis::RouteConstraint do
  subject { Thesis::RouteConstraint.new }
  let(:page) { create :page, template: "default" }

  describe ".matches?" do
    context "proper route" do
      it "returns true" do
        req = Struct.new(:path).new(page.slug)
        expect(subject.matches?(req)).to be_true
      end
    end

    context "invalid route" do
      it "returns false" do
        req = Struct.new(:path).new("invalid")
        expect(subject.matches?(req)).to be_false
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thesis-0.1.3 spec/thesis/routing/thesis_routing_spec.rb