You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How is it possible to have different parameters values for different examples within the same method? Or is is possible at all?
put "/orders/:id" do
let(:id) { order.id }
example_request "Put an order" do
expect(status).to eq 200
end
example "Get an inexistent order" do
let(:id) { -1 }
do_request
expect(status).to eq 422
end
end
=> NoMethodError:
undefined method `let' for #<RSpec::ExampleGroups::
The text was updated successfully, but these errors were encountered:
For the specific error, let is only available in the example group context.
put"/orders/:id"dolet(:id){order.id}example_request"Put an order"doexpect(status).toeq200endcontext"order does not exist"dolet(:id){ -1}example"Get an inexistent order"dodo_requestexpect(status).toeq422endendend
You can also send in an extra hash to do_request that will override that :id key.
put"/orders/:id"dolet(:id){order.id}example_request"Put an order"doexpect(status).toeq200endcontext"order does not exist"doexample"Get an inexistent order"dodo_request(:id=> -1)expect(status).toeq422endendend
How is it possible to have different parameters values for different examples within the same method? Or is is possible at all?
The text was updated successfully, but these errors were encountered: