blob: 65475e296c2d9b6205ea466de044a2eb20156b93 (
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
31
32
33
34
35
|
require 'spec_helper'
describe "/lines/show", :type => :view do
assign_referential
let!(:line) { assign :line, create(:line) }
let!(:line_referential) { assign :line_referential, line.line_referential }
let!(:routes) { assign :routes, Array.new(2) { create(:route, :line => line) }.paginate }
let!(:map) { assign(:map, double(:to_html => '<div id="map"/>'.html_safe)) }
before do
allow(view).to receive_messages(current_organisation: referential.organisation)
end
it "should render h2 with the line name" do
render
expect(rendered).to 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
# FIXME #2018
xit "should render a link to edit the line" do
render
expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.edit_line_referential_line_path(line_referential, line)}']")
end
it "should render a link to remove the line" do
render
expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.line_referential_line_path(line_referential, line)}'][class='remove']")
end
end
|