Sha256: 314d965f329468fd05a619e442004a9f73438a73f998277d1c153acdab60f57c

Contents?: true

Size: 773 Bytes

Versions: 6

Compression:

Stored size: 773 Bytes

Contents

require 'spec_helper'

describe "homepage/_featured_works.html.erb" do
  let(:list) { FeaturedWorkList.new }
  subject { rendered }
  before { assign(:featured_work_list, list) }

  context "without featured works" do
    before { render }
    it { is_expected.to have_content 'No works have been featured' }
    it { is_expected.not_to have_selector('form') }
  end

  context "with featured works" do
    before do
      allow(view).to receive(:can?).with(:update, FeaturedWork).and_return(false)
      allow(list).to receive(:empty?).and_return(false)
      render
    end

    it { is_expected.not_to have_content 'No works have been featured' }
    it { is_expected.not_to have_selector('form') }
    it { is_expected.to have_selector('ol#featured_works') }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-6.7.0 spec/views/homepage/_featured_works.html.erb_spec.rb
sufia-6.6.1 spec/views/homepage/_featured_works.html.erb_spec.rb
sufia-6.6.0 spec/views/homepage/_featured_works.html.erb_spec.rb
sufia-6.5.0 spec/views/homepage/_featured_works.html.erb_spec.rb
sufia-6.4.0 spec/views/homepage/_featured_works.html.erb_spec.rb
sufia-6.3.0 spec/views/homepage/_featured_works.html.erb_spec.rb