Skip to content

Commit

Permalink
Add a step to check the Laravel response
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Jan 28, 2021
1 parent 7847cbf commit 8de4f25
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions features/steps/laravel_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
Laravel.navigate_to(route)
end

Then("the Laravel response matches {string}") do |regex|
wait = Maze::Wait.new(timeout: 10)
success = wait.until { Laravel.last_response != nil }

raise 'No response from the Laravel fixture!' unless success

assert_match(Regexp.new(regex), Laravel.last_response)
end

Then("the exception {string} matches one of the following:") do |path, values|
desired_value = read_key_path(Server.current_request[:body], "events.0.exceptions.0.#{path}")
assert_includes(values.raw.flatten, desired_value)
Expand Down

0 comments on commit 8de4f25

Please sign in to comment.