Sha256: 8decd8b6309f91be51aa42f34d4f3d289446fb250078e60485a3b34eb2728b19
Contents?: true
Size: 1.58 KB
Versions: 2
Compression:
Stored size: 1.58 KB
Contents
require "spec_helper" describe Mascot::SiteController, type: :controller do context "existing templated page" do render_views before { get :show, resource_path: "/time" } let(:resource) { Mascot.configuration.site.get("/time") } it "is status 200" do expect(response.status).to eql(200) end it "renders body" do expect(response.body).to include("<h1>Tick tock, tick tock</h1>") end it "renders layout" do expect(response.body).to include("<title>Dummy</title>") end it "responds with content type" do expect(response.content_type).to eql("text/html") end context "@_mascot_locals assignment" do subject { assigns(:_mascot_locals) } it ":current_page" do expect(subject[:current_page].asset.path).to eql(resource.asset.path) end it ":site" do expect(subject[:resources]).to eql(Mascot.configuration.resources) end end end context "existing static page" do render_views before { get :show, resource_path: "/hi" } it "is status 200" do expect(response.status).to eql(200) end it "renders body" do expect(response.body).to include("<h1>Hi!</h1>") end it "renders layout" do expect(response.body).to include("<title>Dummy</title>") end it "responds with content type" do expect(response.content_type).to eql("text/html") end end context "non-existent page" do it "is status 404" do expect { get :show, resource_path: "/non-existent" }.to raise_exception(ActionController::RoutingError) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
mascot-rails-0.1.12 | spec/mascot/mascot_site_controller_spec.rb |
mascot-rails-0.1.11 | spec/mascot/mascot_site_controller_spec.rb |