Revision 445dd7ab
Added by Daniel Lobato Garcia almost 9 years ago
test/functional/api/v1/architectures_controller_test.rb | ||
---|---|---|
end
|
||
|
||
test "should update architecture" do
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => { } }
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => arch_i386 }
|
||
assert_response :success
|
||
end
|
||
|
||
... | ... | |
test "user with viewer rights should fail to update an architecture" do
|
||
user_one_as_anonymous_viewer
|
||
as_user :one do
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => { } }
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => arch_i386 }
|
||
end
|
||
assert_response :forbidden
|
||
end
|
||
... | ... | |
test "user with manager rights should success to update an architecture" do
|
||
user_one_as_manager
|
||
as_user :one do
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => { } }
|
||
put :update, { :id => architectures(:x86_64).to_param, :architecture => arch_i386 }
|
||
end
|
||
assert_response :success
|
||
end
|
Also available in: Unified diff
Fixes #11089 - Adapt tests to Rails 4
This commit contains all changes to tests in branch
https://github.com/theforeman/foreman/pull/2055 that I found to be
retrocompatible with Rails 3. The more of these we can get in, the less
code we will have to review for Rails 4, and the more relevant it will
be, as it'll be all completly Rails 4 specific.