Sha256: 6c7db38bce43efdb46766b5a38581eca32662a57d8565716de32f9bf136d4bf9

Contents?: true

Size: 965 Bytes

Versions: 7

Compression:

Stored size: 965 Bytes

Contents

require 'rails_helper'

describe "user_import_results/index" do
  fixtures :all

  before(:each) do
    assign(:user_import_results, UserImportResult.page(1))
    admin = User.find('enjuadmin')
    view.stub(:current_user).and_return(admin)
    @ability = EnjuLeaf::Ability.new(admin, '0.0.0.0')
    @ability.extend(CanCan::Ability)
    controller.stub(:current_ability) { @ability }
  end

  it "renders a list of user_import_results" do
    render
    expect(rendered).to match /MyString/
  end

  context "with @user_import_file" do
    before(:each) do
      @user_import_file = UserImportFile.find(1)
      @user_import_results = UserImportResult.where(user_import_file_id: 1).page(1)
    end
    it "renders a list of user_import_results for the user_import_file" do
      render
      expect(view).to render_template "user_import_results/_list_lines"
      expect(rendered).to match /MyString/
      expect(rendered).to match /<td>1<\/td>/
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
enju_leaf-1.1.4 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.3 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.2 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.1 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.0 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.0.rc22 spec/views/user_import_results/index.html.erb_spec.rb
enju_leaf-1.1.0.rc21 spec/views/user_import_results/index.html.erb_spec.rb