Sha256: 11efa6f104e4775d87e78dd755c6d5bf30eadffdca39eab29cdfa38c4c3f18b5
Contents?: true
Size: 1.64 KB
Versions: 22
Compression:
Stored size: 1.64 KB
Contents
require 'rails_helper' describe "manifestations/show" do fixtures :all before(:each) do assign(:manifestation, FactoryBot.create(:manifestation)) allow(view).to receive(:policy).and_return double(create?: false, udpate?: false, destroy?: false) end it "renders attributes in <p>" do render # Run the generator again with the --webrat flag if you want to use webrat matchers rendered.should match(/1/) end describe "identifier_link" do it "renders a link to CiNii Books" do assign(:manifestation, manifestations(:manifestation_00217)) render rendered.should include '<a href="https://ci.nii.ac.jp/ncid/BN15603730">BN15603730</a>' end end describe "when logged in as Librarian" do before(:each) do user = assign(:profile, FactoryBot.create(:librarian)) view.stub(:current_user).and_return(user) allow(view).to receive(:policy).and_return double(create?: true, update?: true, destroy?: true) end it "should have an ISBD separator for extent and dimensions" do assign(:manifestation, FactoryBot.create(:manifestation, extent: "extent value", dimensions: "dimensions value")) render expect(rendered).to match /\s+;\s+/ end end describe "when logged in as User" do before(:each) do user = assign(:profile, FactoryBot.create(:user)) view.stub(:current_user).and_return(user) end it "should have an ISBD separator for extent and dimensions" do assign(:manifestation, FactoryBot.create(:manifestation, extent: "extent value", dimensions: "dimensions value")) render expect(rendered).to match /\s+;\s+/ end end end
Version data entries
22 entries across 22 versions & 1 rubygems