Skip to content

Commit

Permalink
Fix view test that was failing intermittently
Browse files Browse the repository at this point in the history
  • Loading branch information
hackartisan committed Sep 7, 2017
1 parent 0e41903 commit 167a40a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/views/sufia/admin/admin_sets/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
let(:solr_doc) { SolrDocument.new(admin_set.to_solr) }
let(:admin_sets) { [solr_doc] }
let(:presenter_class) { Sufia::AdminSetPresenter }
let(:presenter) { instance_double(presenter_class, total_items: 99) }
let(:ability) { instance_double("Ability") }
before do
allow(controller).to receive(:current_ability).and_return(ability)
allow(controller).to receive(:presenter_class).and_return(presenter_class)
allow(presenter_class).to receive(:new).and_return(presenter)
assign(:admin_sets, admin_sets)
end
it "lists admin set" do
render
expect(rendered).to have_content('Example Admin Set')
expect(rendered).to have_content('jdoe@example.com')
expect(rendered).to have_css("td", text: /^0$/)
expect(rendered).to have_css("td", text: /^99$/)
end
end
end

0 comments on commit 167a40a

Please sign in to comment.