Last active
July 1, 2016 18:17
-
-
Save astery/7961e88a108e7513a430094b25e0c628 to your computer and use it in GitHub Desktop.
Revisions
-
astery revised this gist
Jul 1, 2016 . 2 changed files with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ pasha: mobile_number: 404040 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ bus: id: 1 name: bus -
astery created this gist
Jul 1, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ rake test:integration This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ class PbxTest < ActionDispatch::IntegrationTest include JsonHelper def setup @pasha = passengers(:pasha) @bus = teams(:bus) end test "generate ticket code for pasha and use it" do post '/pbx/ticket_codes/generate', pasha_call_params assert json_response['code'] assert json_response['registred'] == true get "/tickets", pasha_call_params assert_equal 1, json_response.count assert json_response[0]['usable'] post "/tickets/use_available_or_buy_and_use", conductor_check_pasha_params assert json_response['ok'] get "/tickets", pasha_call_params assert_equal 1, json_response.count get "/tickets/has_right_to_ride_in_team", conductor_check_pasha_params assert_equal 1, json_response.count end def pasha_call_params { mobile_number: @pasha.mobile_number, source: '101010' } end end