Revision 6c31e508
Added by Greg Sutcliffe over 10 years ago
test/functional/api/v1/usergroups_controller_test.rb | ||
---|---|---|
|
||
class Api::V1::UsergroupsControllerTest < ActionController::TestCase
|
||
|
||
def setup
|
||
as_admin { @usergroup = FactoryGirl.create(:usergroup) }
|
||
end
|
||
|
||
valid_attrs = { :name => 'test_usergroup' }
|
||
|
||
test "should get index" do
|
||
... | ... | |
end
|
||
|
||
test "should show individual record" do
|
||
get :show, { :id => usergroups(:one).to_param }
|
||
get :show, { :id => @usergroup.to_param }
|
||
assert_response :success
|
||
show_response = ActiveSupport::JSON.decode(@response.body)
|
||
assert !show_response.empty?
|
||
... | ... | |
end
|
||
|
||
test "should update usergroup" do
|
||
put :update, { :id => usergroups(:one).to_param, :usergroup => { } }
|
||
put :update, { :id => @usergroup.to_param, :usergroup => { } }
|
||
assert_response :success
|
||
end
|
||
|
||
test "should destroy usergroups" do
|
||
assert_difference('Usergroup.count', -1) do
|
||
delete :destroy, { :id => usergroups(:one).to_param }
|
||
delete :destroy, { :id => @usergroup.to_param }
|
||
end
|
||
assert_response :success
|
||
end
|
Also available in: Unified diff
Fixes #3293 add FactoryGirl to tests
(cherry picked from commit 3035495f1aa94108c7d60610fa53ca6b43bbaa56)