Last active
June 7, 2017 17:51
-
-
Save jtmkrueger/27eb4efe1fcd7736c4cf389a4df04e15 to your computer and use it in GitHub Desktop.
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 characters
class PretendController < ApplicationController | |
def create | |
render params | |
end | |
end |
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 characters
require 'rails_helper' | |
RSpec.describe PretendController, type: :controller do | |
it 'is stupid' do | |
params_a = {foo: 'bar'} | |
post :create, params_a | |
expect(response.request.params).to include params_a | |
params_b = {foo: 'baro'} | |
expect{post :create, params_b} | |
expect(response.request.params).to include params_b | |
end | |
end |
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 characters
DEPRECATED: Passing a block to Capybara::server is deprecated, please use Capybara::register_server instead | |
Run options: include {:focus=>true} | |
All examples were filtered out; ignoring {:focus=>true} | |
Forced option passed this will rebuild indexes (drop them and then create them again) | |
Index created for listings | |
Index created for people | |
Index created for projects | |
6/6 Listings: |================================================= 100 =================================================| | |
44/44 People: |================================================= 100 =================================================| | |
3/3 Projects: |================================================= 100 =================================================| | |
PretendController | |
is stupid (FAILED - 1) | |
Failures: | |
1) PretendController is stupid | |
Failure/Error: expect(response.request.params).to include params_b | |
expected {"foo" => "bar", "controller" => "pretend", "action" => "create"} to include {:foo => "baro"} | |
Diff: | |
@@ -1,2 +1,4 @@ | |
-[{:foo=>"baro"}] | |
+"action" => "create", | |
+"controller" => "pretend", | |
+"foo" => "bar", | |
# ./spec/controllers/pretend_controller_spec.rb:11:in `block (2 levels) in <top (required)>' | |
Finished in 2.38 seconds (files took 5.46 seconds to load) | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/controllers/pretend_controller_spec.rb:4 # PretendController is stupid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment