spec/controllers/hyrax/collections_controller_spec.rb in hyrax-3.0.0.pre.beta2 vs spec/controllers/hyrax/collections_controller_spec.rb in hyrax-3.0.0.pre.beta3
- old
+ new
@@ -30,11 +30,13 @@
end
end
it "returns the collection and its members" do # rubocop:disable RSpec/ExampleLength
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
- expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'), "aria-current" => "page")
get :show, params: { id: collection }
expect(response).to be_successful
expect(response).to render_template("layouts/hyrax/1_column")
expect(assigns[:presenter]).to be_kind_of Hyrax::CollectionPresenter
expect(assigns[:presenter].title).to match_array collection.title
@@ -66,10 +68,12 @@
end
context "without a referer" do
it "sets breadcrumbs" do
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
- expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
+ expect(controller).to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'), "aria-current" => "page")
get :show, params: { id: collection }
expect(response).to be_successful
end
end