Sha256: 75d64f69e5466489dcd9f622effccfaa0ffd3ed4371fc8119b2c600d24ebb3b4

Contents?: true

Size: 1.1 KB

Versions: 44

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe 'krikri/qa_reports/index.html.erb', type: :view do
  let(:reports) { [double, double] }
  let(:provider) { build(:krikri_provider) }

  before do
    reports.each_with_index do |report, i|
      allow(report).to receive(:id).and_return(i.to_s)
      allow(report).to receive(:build_provider)
                        .and_return(provider)

      allow(view).to receive(:qa_report_path).with(report, format: 'csv')
                      .and_return("report#{i}_csv_link")

      allow(view).to receive(:qa_report_path)
                      .with(report, format: 'csv', type: 'count')
                      .and_return("report#{i}_count_csv_link")
    end

    assign(:reports, reports)
  end

  it 'gives provider by name' do
    render
    expect(rendered).to include view.provider_name(provider)
  end

  it 'links to csv' do
    render
    reports.each do |report|
      expect(rendered).to include "#{report.id}_csv_link"
    end
  end

  it 'links to counts csv' do
    render
    reports.each do |report|
      expect(rendered).to include "#{report.id}_count_csv_link"
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
krikri-0.15.2 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.15.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.15.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.14.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.13.2 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.13.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.13.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.12.4 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.12.3 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.12.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.12.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.12.0.pre.rc.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.11.2 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.11.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.11.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.10.1 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.10.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.9.0 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.8.9 spec/views/krikri/qa_reports/index.html.erb_spec.rb
krikri-0.8.8 spec/views/krikri/qa_reports/index.html.erb_spec.rb