aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/timebands/index.html.erb_spec.rb
blob: 0ce0c419cb42463631852ee2321d990d0619481b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'spec_helper'

describe "/timebands/index", :type => :view do

  assign_referential
  let!(:timebands) { assign :timebands, Array.new(2){ create(:timeband) }.paginate }

  it "should render a show link for each timeband" do
    render
    timebands.each do |timeband|
      expect(rendered).to have_selector("a[href='#{view.referential_timeband_path(referential, timeband)}']", :text => timeband.name)
    end
  end

  it "should render a link to create a new timeband" do
    render
    expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_referential_timeband_path(referential)}']")
  end

end