Sha256: 499a55b276a86c2652eaad193d23f152843f04d22a7d8eb0eaf79af267e9b287

Contents?: true

Size: 748 Bytes

Versions: 5

Compression:

Stored size: 748 Bytes

Contents

require "spec_helper"

describe "Mascot routes", type: :routing do
  context "routes enabled" do
    before do
      Mascot.configuration.routes = true
      Rails.application.reload_routes!
    end
    it "generates link" do
      expect(page_path("hi")).to eql("/hi")
    end
    it "is routable" do
      expect(get("/hi")).to route_to(controller: "mascot/site", action: "show", resource_path: "hi")
    end
  end
  context "routes disabled" do
    before do
      Mascot.configuration.routes = false
      Rails.application.reload_routes!
    end
    it "is not routable" do
      expect(get("/hi")).to_not be_routable
    end
    it "does not generate link" do
      expect{page_path("hi")}.to raise_exception(NoMethodError)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mascot-rails-0.1.16 spec/mascot/routes_spec.rb
mascot-rails-0.1.15 spec/mascot/routes_spec.rb
mascot-rails-0.1.14 spec/mascot/routes_spec.rb
mascot-rails-0.1.12 spec/mascot/routes_spec.rb
mascot-rails-0.1.11 spec/mascot/routes_spec.rb