Sha256: 24175ccdceabc7d7ab3e4f4d118a82cbf14dd63cfbf395e1cc1e1578fc6072aa

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

require 'rails_helper'

describe "accepts/index" do
  fixtures :all

  before(:each) do
    assign(:accepts, Kaminari::paginate_array([
      stub_model(Accept,
        :item_id => 1,
        :created_at => Time.zone.now
      ),
      stub_model(Accept,
        :item_id => 1,
        :created_at => Time.zone.now
      )
    ]).page(1))
    basket = FactoryBot.create(:basket)
    assign(:basket, basket)
    assign(:accept, basket.accepts.new)
  end

  it "renders a list of accepts" do
    allow(view).to receive(:policy).and_return double(create?: true, destroy?: true)
    render
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_library-0.2.5 spec/views/accepts/index.html.erb_spec.rb
enju_library-0.2.4 spec/views/accepts/index.html.erb_spec.rb