aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
authorVlatka Pavisic2017-04-11 15:35:01 +0200
committerVlatka Pavisic2017-04-11 15:35:01 +0200
commitaa481c087b162bc775b4418e205f91c5b6bead19 (patch)
tree914ba9b39e0338317bcc2bfd839f745647beda1a /spec/controllers
parent8adf909694b52959483818bf839d6e180015eb99 (diff)
downloadchouette-core-aa481c087b162bc775b4418e205f91c5b6bead19.tar.bz2
Refs #3047: Associate RoutingConstraintZone with StopPoints
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/route_stop_points_controller_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/route_stop_points_controller_spec.rb b/spec/controllers/route_stop_points_controller_spec.rb
new file mode 100644
index 000000000..2f5fa41c7
--- /dev/null
+++ b/spec/controllers/route_stop_points_controller_spec.rb
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+RSpec.describe RouteStopPointsController, type: :controller do
+ login_user
+
+ let(:referential) { Referential.first }
+ let!(:line) { create :line }
+ let!(:route) { create :route, line: line }
+
+ describe 'GET index' do
+ before(:each) { get :index, referential_id: referential.id, line_id: line.id, route_id: route.id, format: :json }
+
+ it 'returns HTTP success' do
+ expect(response).to be_success
+ end
+
+ it 'returns a JSON of stop areas' do
+ expect(response.body).to eq(route.stop_points.map { |sp| { id: sp.id, name: sp.name } }.to_json)
+ end
+ end
+end
+
+