Sha256: eeddc8eb152e4bdd11cf76e3a8f2dd619ab85f510b00aee6bf0db13437ef09b1

Contents?: true

Size: 1020 Bytes

Versions: 6

Compression:

Stored size: 1020 Bytes

Contents

require 'spec_helper'

describe "resource_import_results/index" do
  fixtures :all

  before(:each) do
    assign(:resource_import_results, ResourceImportResult.page(1))
    admin = User.find('enjuadmin')
    view.stub(:current_resource).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 resource_import_results" do
    render
    expect(rendered).to match /MyString/
  end

  context "with @resource_import_file" do
    before(:each) do
      @resource_import_file = ResourceImportFile.find(1)
      @resource_import_results = ResourceImportResult.where(resource_import_file_id: 1).page(1)
    end
    it "renders a list of resource_import_results for the resource_import_file" do
      render
      expect(view).to render_template "resource_import_results/_list_lines"
      expect(rendered).to match /MyString/
      expect(rendered).to match /<td>1<\/td>/
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
enju_biblio-0.1.3 spec/views/resource_import_results/index.html.erb_spec.rb
enju_biblio-0.1.2 spec/views/resource_import_results/index.html.erb_spec.rb
enju_biblio-0.1.1 spec/views/resource_import_results/index.html.erb_spec.rb
enju_biblio-0.1.0 spec/views/resource_import_results/index.html.erb_spec.rb
enju_biblio-0.1.0.pre71 spec/views/resource_import_results/index.html.erb_spec.rb
enju_biblio-0.1.0.pre70 spec/views/resource_import_results/index.html.erb_spec.rb