Sha256: 9c7c9f24cff28ababcfec0b28cfa0b598d5a87c93cd36166ee55a994f503e5ba

Contents?: true

Size: 949 Bytes

Versions: 44

Compression:

Stored size: 949 Bytes

Contents

require 'spec_helper'

describe 'curation_concerns/base/unauthorized.html.erb' do
  context "when it responds to curation_concern" do
    let(:concern) { double(human_readable_type: 'Book', id: '777') }
    before do
      allow(view).to receive(:curation_concern).and_return(concern)
      render
    end
    it "shows a message to the user" do
      expect(rendered).to have_content "Unauthorized The book you have tried to access is private ID: 777"
    end

    context "and the concern is nil" do
      let(:concern) { nil }
      it "shows a message to the user" do
        expect(rendered).to have_content "Unauthorized The page you have tried to access is private"
      end
    end
  end

  context "when it doesn't respond to curation_concern" do
    before do
      render
    end
    it "shows a message to the user" do
      expect(rendered).to have_content "Unauthorized The page you have tried to access is private"
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.7 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-2.0.0 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-2.0.0.rc2 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.6 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.5 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.4 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.3 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.2 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-2.0.0.rc1 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.1 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.0 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.7.0.beta1 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.6.3 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.6.2 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.6.1 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.6.0 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.5.0 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.4.0 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb
curation_concerns-1.3.3 spec/views/curation_concerns/base/unauthorized.html.erb_spec.rb