Skip to content

Commit

Permalink
Specify params explicitely in controller specs
Browse files Browse the repository at this point in the history
  • Loading branch information
fragoulis committed May 31, 2017
1 parent 0efb541 commit d9be4fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/support/helpers.rb
Expand Up @@ -2,7 +2,13 @@

class ActiveSupport::TestCase
def cmd(name, env={}, as="someone")
post "/cogy/cmd/#{name}", env.merge("COG_CHAT_HANDLE" => as)
params = if Rails::VERSION::MAJOR >= 5
{ params: env.merge("COG_CHAT_HANDLE" => as) }
else
env.merge("COG_CHAT_HANDLE" => as)
end

post "/cogy/cmd/#{name}", params
end

def fetch_inventory
Expand Down

0 comments on commit d9be4fc

Please sign in to comment.