Sha256: b9e7a4ccd16b79e920af5409dedc4d37f24a4713bf339eb474c9b331d5ee75cb

Contents?: true

Size: 1.04 KB

Versions: 19

Compression:

Stored size: 1.04 KB

Contents

require 'rails_helper'

describe "use_restrictions/index" do
  fixtures :users, :roles, :user_has_roles

  before(:each) do
    view.extend EnjuLeaf::ApplicationHelper

    assign(:use_restrictions, Kaminari::paginate_array([
      stub_model(UseRestriction,
                 name: "Not For Loan",
                 display_name: "Not For Loan",
                 note: "MyText",
                 position: 1
      ),
      stub_model(UseRestriction,
                 name: "On Loan",
                 display_name: "On Loan",
                 note: "MyText",
                 position: 2
      )
    ]).page(1))
  end

  it "renders a list of use_restrictions" do
    allow(view).to receive(:policy).and_return double(create?: true, update?: true, destroy?: true)
    render
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td:nth-child(3)", /Not For Loan/
    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "tr>td:nth-child(3)", /MyText/
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

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