Sha256: 6a5688bdc9f19e3e24f96d8d8070fff090c805160afeff325a4a3a26d45f949c

Contents?: true

Size: 735 Bytes

Versions: 12

Compression:

Stored size: 735 Bytes

Contents

require 'rails_helper'

describe "manifestations/show" do
  fixtures :all

  before(:each) do
    assign(:manifestation, FactoryBot.create(:item).manifestation)
    allow(view).to receive(:policy).and_return double(create?: false, udpate?: false, destroy?: false)
  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 the total number of checkouts" do
      render
      expect(rendered).to have_css "div.manifestation_total_checkouts", text: /\A\s*.*?: \d+/
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
enju_circulation-0.3.11 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.10 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.9 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.4.0.rc.1 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.8 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.7 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.4.0.beta.4 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.4.0.beta.3 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.6 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.4.0.beta.2 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.4.0.beta.1 spec/views/manifestations/show.html.erb_spec.rb
enju_circulation-0.3.5 spec/views/manifestations/show.html.erb_spec.rb