Fix TestHelper not working when no parameters are given #57

Merged
merged 1 commit into from Mar 5, 2013
@@ -77,7 +77,7 @@ def have_decoded_response(value)
# Like process, but automatically adds the api version.
def process(action, http_method = 'GET', *args)
# Rails 4 changes the method signature. In rails 3, http_method is actually
- # the paramters.
+ # the parameters.
if http_method.kind_of?(String)
parameters, session, flash = args
else
@@ -89,7 +89,7 @@ def process(action, http_method = 'GET', *args)
if _default_version.present? && parameters[:version].blank? && parameters['version'].blank?
parameters[:version] = _default_version
end
- super
+ super action, parameters, *args
end
def normalise_value(value)
@@ -20,10 +20,17 @@ def self.teardown(*args); end
end
describe 'should have_exposed' do
- it "allows you to asset what should have been exposed by an action" do
- get :echo, :echo => "ping"
-
- response.should have_exposed(:echo => "ping")
+ context "given a request with parameters" do
+ it "allows you to asset what should have been exposed by an action" do
+ get :echo, :echo => "ping"
+ response.should have_exposed(:echo => "ping")
+ end
+ end
+ context "given a request without parameters" do
+ it "allows you to asset what should have been exposed by an action" do
+ get :test_data
+ request.params.should include(:version)
+ end
end
end
end