Sha256: 538d73041aced9ab79040486976b4d1e733ade2cd4dfdbe2c317281db3c17b00

Contents?: true

Size: 714 Bytes

Versions: 17

Compression:

Stored size: 714 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 = FactoryGirl.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

17 entries across 15 versions & 2 rubygems

Version Path
enju_library-0.2.3 spec/views/withdraws/index.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/spec/views/withdraws/index.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/spec/views/withdraws/index.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.2 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.1 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.10 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.9 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.8 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.7 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.6 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.5 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.4 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.3 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.2 spec/views/withdraws/index.html.erb_spec.rb
enju_library-0.2.0.beta.1 spec/views/withdraws/index.html.erb_spec.rb