Commit 66ea702f by Đường Sỹ Hoàng

Fixed space

parent e20d4aca
...@@ -25,7 +25,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest ...@@ -25,7 +25,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test "should redirect update when logged in as wrong user" do test "should redirect update when logged in as wrong user" do
log_in_as(@other_user) log_in_as(@other_user)
patch user_path(@user), params: { user: { name: @user.name,email: @user.email } } patch user_path(@user), params: { user: { name: @user.name, email: @user.email } }
assert flash.empty? assert flash.empty?
assert_redirected_to root_url assert_redirected_to root_url
end end
...@@ -39,7 +39,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest ...@@ -39,7 +39,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test "should not allow the admin attribute to be edited via the web" do test "should not allow the admin attribute to be edited via the web" do
log_in_as(@other_user) log_in_as(@other_user)
assert_not @other_user.admin? assert_not @other_user.admin?
patch user_path(@other_user), params: {user:{ password: @other_user.password,password_confirmation: @other_user.password, admin: true } } patch user_path(@other_user), params: {user:{ password: @other_user.password, password_confirmation: @other_user.password, admin: true } }
assert_not @other_user.reload.admin? assert_not @other_user.reload.admin?
end end
end end
...@@ -10,7 +10,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest ...@@ -10,7 +10,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
log_in_as(@user) log_in_as(@user)
get edit_user_path(@user) get edit_user_path(@user)
assert_template "users/edit" assert_template "users/edit"
patch user_path(@user), params: { user: { name: "",email: "foo@invalid",password: "foo",password_confirmation: "bar" } } patch user_path(@user), params: { user: { name: "", email: "foo@invalid", password: "foo", password_confirmation: "bar" } }
assert_template "users/edit" assert_template "users/edit"
end end
...@@ -20,7 +20,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest ...@@ -20,7 +20,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
assert_template "users/edit" assert_template "users/edit"
name = "Foo Bar" name = "Foo Bar"
email = "foo@bar.com" email = "foo@bar.com"
patch user_path(@user), params: { user: { name: name,email: email,password: "",password_confirmation: "" } } patch user_path(@user), params: { user: { name: name,email: email, password: "", password_confirmation: "" } }
assert_not flash.empty? assert_not flash.empty?
assert_redirected_to @user assert_redirected_to @user
@user.reload @user.reload
...@@ -34,7 +34,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest ...@@ -34,7 +34,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
assert_redirected_to edit_user_url(@user) assert_redirected_to edit_user_url(@user)
name = "Foo Bar" name = "Foo Bar"
email = "foo@bar.com" email = "foo@bar.com"
patch user_path(@user), params: { user: { name: name, email: email,password:"",password_confirmation: "" } } patch user_path(@user), params: { user: { name: name, email: email, password:"", password_confirmation: "" } }
assert_not flash.empty? assert_not flash.empty?
assert_redirected_to @user assert_redirected_to @user
@user.reload @user.reload
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment