Added test for user prefs JSON response
This commit is contained in:
parent
143a90fcac
commit
a968c1b923
1 changed files with 9 additions and 0 deletions
|
@ -62,6 +62,15 @@ module Api
|
||||||
assert_select "preference[k=\"#{user_preference2.k}\"][v=\"#{user_preference2.v}\"]", :count => 1
|
assert_select "preference[k=\"#{user_preference2.k}\"][v=\"#{user_preference2.v}\"]", :count => 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Test json
|
||||||
|
get user_preferences_path(:format => "json"), :headers => auth_header
|
||||||
|
assert_response :success
|
||||||
|
assert_equal "application/json", @response.media_type
|
||||||
|
|
||||||
|
js = ActiveSupport::JSON.decode(@response.body)
|
||||||
|
assert_not_nil js
|
||||||
|
assert_equal 2, js["preferences"].count
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue