Skip to content
Browse files

refactored REST mock a bit

  • Loading branch information...
1 parent 5ed76bc commit 4e4fee0f280022be724eaf39560d922668e91c9a @titanous titanous committed Dec 3, 2008
Showing with 4 additions and 5 deletions.
  1. +4 −5 test/mocks/rest.rb
View
9 test/mocks/rest.rb
@@ -34,14 +34,13 @@ def request(resource, method = "get", args = nil)
"OK\n#{@session_id}\n#{@now_playing_url}\n#{@submission_url}"
end
elsif @base_url == @now_playing_url
- if args[:s] == @session_id && !args[:a].blank? && !args[:t].blank? && !args[:b].blank? &&
- !args[:n].blank?
+ if args[:s] == @session_id && ![args[:a], args[:t], args[:b], args[:n]].any?(&:blank?)
'OK'
end
elsif @base_url == @submission_url
- if args[:s] == @session_id && !args['a[0]'].blank? && !args['t[0]'].blank? &&
- !args['i[0]'].blank? && !args['o[0]'].blank? && !args['l[0]'].blank? && !args['b[0]'].blank?
- 'OK'
+ if args[:s] == @session_id &&
+ ![args['a[0]'], args['t[0]'], args['i[0]'], args['o[0]'], args['l[0]'], args['b[0]']].any?(&:blank?)
+ 'OK'
end
end

0 comments on commit 4e4fee0

Please sign in to comment.
Something went wrong with that request. Please try again.