aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/lines/show.html.erb_spec.rb
blob: 894956ed08bc0199e4d8fd891a63f9850c9fde89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'spec_helper'

describe "/lines/show" do
  
  let!(:referential) { assign :referential, Factory(:referential) }
  let!(:line) { assign :line, Factory(:line) }
  let!(:map) { assign(:map, mock(:to_html => '<div id="map"/>')) }

  it "should render h2 with the line name" do
    render
    rendered.should have_selector("h2", :text => Regexp.new(line.name))
  end

  # it "should display a map with class 'line'" do
  #   render
  #   rendered.should have_selector("#map", :class => 'line')
  # end

  it "should render a link to edit the line" do
    render
    view.content_for(:sidebar).should have_selector(".actions a[href='#{view.edit_referential_line_path(referential, line)}']")
  end

  it "should render a link to remove the line" do
    render
    view.content_for(:sidebar).should have_selector(".actions a[href='#{view.referential_line_path(referential, line)}'][class='remove']")
  end

end