Sha256: 4e7e580825cee3cc7f99e0eb7e34e9606df3bdf8f5909964b04a28b43822cf12

Contents?: true

Size: 803 Bytes

Versions: 11

Compression:

Stored size: 803 Bytes

Contents

require 'rails_helper'

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

  before(:each) do
    assign(:withdraw, stub_model(Withdraw,
      :item_id => 1
    ).as_new_record)
    assign(:basket, baskets(:basket_00001))
    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))
    view.stub(:current_user).and_return(User.friendly.find('enjuadmin'))
  end

  it "renders new withdraw form" do
    render

    assert_select "form", :action => withdraws_path, :method => "post" do
      assert_select "input#withdraw_item_identifier", :name => "withdraw[item_identifier]"
    end
  end
end

Version data entries

11 entries across 9 versions & 2 rubygems

Version Path
enju_library-0.2.5 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.4 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.3 spec/views/withdraws/new.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.2/spec/views/withdraws/new.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/bundler/gems/enju_library-d36f415e177e/spec/views/withdraws/new.html.erb_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_library-0.2.1/spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.2 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.1 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.0 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.0.beta.10 spec/views/withdraws/new.html.erb_spec.rb
enju_library-0.2.0.beta.9 spec/views/withdraws/new.html.erb_spec.rb