aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views
diff options
context:
space:
mode:
authorTeddy Wing2017-07-12 11:50:08 +0200
committerTeddy Wing2017-07-12 11:50:08 +0200
commit25e0a8c896d2562a91f3fcea8e5f6ffba972f149 (patch)
tree7f4d01b42bf2cd007f0f3e8c4bf88f4a7e998d03 /spec/views
parente49dab499770d36a24c554019225092059a8cfa2 (diff)
downloadchouette-core-25e0a8c896d2562a91f3fcea8e5f6ffba972f149.tar.bz2
routes/show.html.erb_spec.rb: Update for new table builder helper
Need to decorate the stop points collection in order to be able to call `#action_links` on the objects therein. Added a stub for `pundit_user` to get around `TableBuilderHelper#table_builder_2` having a dependency on `ApplicationController#pundit_user`. Don't like this stub at all. Should be doing this in a better way. Refs #3479
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/routes/show.html.erb_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/views/routes/show.html.erb_spec.rb b/spec/views/routes/show.html.erb_spec.rb
index 538563578..dae8c9ed3 100644
--- a/spec/views/routes/show.html.erb_spec.rb
+++ b/spec/views/routes/show.html.erb_spec.rb
@@ -3,7 +3,12 @@ RSpec.describe "/routes/show", type: :view do
assign_referential
let!(:line) { assign :line, create(:line) }
let!(:route) { assign :route, create(:route, :line => line).decorate(context: {referential: referential, line: line }) }
- let!(:route_sp) { assign :route_sp, route.stop_points }
+ let!(:route_sp) do
+ assign :route_sp, ModelDecorator.decorate(
+ route.stop_points,
+ with: StopPointDecorator
+ )
+ end
before do
self.params.merge!({
@@ -12,6 +17,10 @@ RSpec.describe "/routes/show", type: :view do
referential_id: referential.id
})
allow(view).to receive(:current_referential).and_return(referential)
+ allow(view).to receive(:pundit_user).and_return(UserContext.new(
+ build_stubbed(:user),
+ referential
+ ))
end
it "should render h1 with the route name" do