Sha256: 5e4559e3f92fb152502e762e66c2357fb0875090ff65f171f0106695bd2d79a5
Contents?: true
Size: 1.19 KB
Versions: 2
Compression:
Stored size: 1.19 KB
Contents
require 'spec_helper' describe "reserves/index" do fixtures :users, :roles, :user_has_roles, :reserves before(:each) do view.extend EnjuLeaf::EnjuLeafHelper assign(:reserves, Reserve.page(1)) view.stub(:current_user).and_return(User.where(username: 'enjuadmin').first) view.stub(:params).and_return(ActionController::Parameters.new) end it "renders a list of reserves" do allow(view).to receive(:policy).and_return double(create?: true, update?: true, destroy?: true) render # Run the generator again with the --webrat flag if you want to use webrat matchers assert_select "tr>td:nth-child(1)", :text => reserves(:reserve_00001).id.to_s assert_select "tr>td:nth-child(2)", :text => /#{reserves(:reserve_00001).user.username}/ assert_select "tr>td:nth-child(2)", :text => /#{reserves(:reserve_00002).manifestation.original_title}/ end it "renders a list of reserves when a reserve does not have expired_at" do reserve = FactoryGirl.create(:reserve, :expired_at => nil) assign(:reserves, Reserve.page(2)) allow(view).to receive(:policy).and_return double(create?: true, update?: true, destroy?: true) render rendered.should match /<td/ end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
enju_circulation-0.2.0.beta.2 | spec/views/reserves/index.html.erb_spec.rb |
enju_circulation-0.2.0.beta.1 | spec/views/reserves/index.html.erb_spec.rb |