Sha256: a4f66a877cd2e892005c72ac602f2aea26b1250dbf625017d50421da523a7310

Contents?: true

Size: 701 Bytes

Versions: 21

Compression:

Stored size: 701 Bytes

Contents

require 'rails_helper'

RSpec.describe "withdraws/index", type: :view do
  fixtures :all

  before(:each) do
    assign(:withdraws, Kaminari::paginate_array([
      stub_model(Withdraw,
        item_id: 1,
        created_at: Time.zone.now
      ),
      stub_model(Withdraw,
        item_id: 1,
        created_at: Time.zone.now
      )
    ]).page(1))
    basket = FactoryBot.create(:basket)
    assign(:basket, basket)
    assign(:withdraw, basket.withdraws.new)
    view.stub(:current_user).and_return(User.friendly.find('enjuadmin'))
  end

  it "renders a list of withdraws" do
    allow(view).to receive(:policy).and_return double(destroy?: true)
    render
    assert_select "tr>td"
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
enju_library-0.3.11 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.10 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.9 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.8 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.8.rc.2 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.8.rc.1 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.4.0.rc.1 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.7 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.6 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.4.0.beta.4 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.4.0.beta.3 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.4.0.beta.2 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.4.0.beta.1 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.5 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.4 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.3 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.2 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.1 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.0 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.3.0.rc.1 spec/views/withdraws/index.html.erb_spec.rb