otwarchive-symphonyarchive/spec/controllers/collection_profile_controller_spec.rb

22 lines
675 B
Ruby
Raw Normal View History

2026-03-11 22:22:11 +00:00
require 'spec_helper'
describe CollectionProfileController do
include RedirectExpectationHelper
let(:collection) { create(:collection) }
describe "GET #show" do
context "collection does not exist" do
it "redirects and provides an error message" do
get :show, params: { collection_id: "A non existent collection" }
it_redirects_to_with_error(collections_path, "What collection did you want to look at?")
end
end
it "assigns subtitle with collection title and profile" do
get :show, params: { collection_id: collection.name }
expect(assigns[:page_subtitle]).to eq("#{collection.title} - Profile")
end
end
end