diff options
| author | Marc Florisson | 2012-04-25 15:30:59 +0200 | 
|---|---|---|
| committer | Marc Florisson | 2012-04-25 15:30:59 +0200 | 
| commit | c3f4535302656bd54ad58e05356a5793ef117f46 (patch) | |
| tree | 694167f72951987b8b38e9be1f870b4fc7f52a91 /spec/views | |
| parent | ec0a142a2722c3e50076a9a60b1f0c7d811f9684 (diff) | |
| download | chouette-core-c3f4535302656bd54ad58e05356a5793ef117f46.tar.bz2 | |
remove useless facotries and use chouette-ninoxe one's
Diffstat (limited to 'spec/views')
| -rw-r--r-- | spec/views/routes/show.html.erb_spec.rb | 32 | 
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/views/routes/show.html.erb_spec.rb b/spec/views/routes/show.html.erb_spec.rb new file mode 100644 index 000000000..05d783eb0 --- /dev/null +++ b/spec/views/routes/show.html.erb_spec.rb @@ -0,0 +1,32 @@ +require 'spec_helper' + +describe "/routes/show" do +   +  let!(:referential) { assign :referential, create(:referential) } +  let!(:line) { assign :line, create(:line) } +  let!(:route) { assign :route, create(:route, :line => line) } +  let!(:stop_areas) { assign :stop_areas, Array.new(2) { create(:stop_area) }.paginate } +  let!(:map) { assign(:map, mock(:to_html => '<div id="map"/>')) } + +  it "should render h2 with the route 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 route" do +    render +    view.content_for(:sidebar).should have_selector(".actions a[href='#{view.edit_referential_line_route_path(referential, line, route)}']") +  end + +  it "should render a link to remove the route" do +    render +    view.content_for(:sidebar).should have_selector(".actions a[href='#{view.referential_line_route_path(referential, line, route)}'][class='remove']") +  end + +end +  | 
