Skip to content

Commit 2a96b91

Browse files
committed
Remove skip() in tests & Fix test
+ 失敗していたテストのスキップを外した + test/test_helper.rb のmock作成時に uid を user.id にしていた箇所を user.uid に変更することで,ほとんどの テストが成功するようになった + 上記変更後も,should_destroy_user は失敗する + 以前の議論により,ユーザは基本的に削除しない方針になった ため,should_destroy_user を含めたユーザ削除に関する テストを削除した.
1 parent 7fc0aae commit 2a96b91

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

test/controllers/tasks_controller_test.rb

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class TasksControllerTest < ActionDispatch::IntegrationTest
5656
end
5757

5858
test "should update task" do
59-
skip ''
6059
log_in_as(@user)
6160
patch task_url(@task), params: { task: { content: @task.content, creator_id: @task.creator_id, task_state_id: @task.task_state_id } }
6261
assert_redirected_to tasks_url

test/controllers/users_controller_test.rb

-17
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
2424
end
2525

2626
test "should get edit" do
27-
skip ''
2827
log_in_as(@user)
2928
get edit_user_url(@user)
3029
assert_response :success
@@ -36,7 +35,6 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
3635
end
3736

3837
test "should update user" do
39-
skip ''
4038
log_in_as(@user)
4139
patch user_url(@user), params: { user: { name: @user.name } }
4240
assert_redirected_to user_url(@user)
@@ -46,19 +44,4 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
4644
patch user_url(@user), params: { user: { name: @user.name } }
4745
assert_redirected_to welcome_path
4846
end
49-
50-
test "should destroy user" do
51-
skip ''
52-
log_in_as(@user)
53-
assert_difference('User.count', -1) do
54-
delete user_url(@user)
55-
end
56-
57-
assert_redirected_to projects_url
58-
end
59-
60-
test "should redirect destroy to login" do
61-
delete user_url(@user)
62-
assert_redirected_to welcome_path
63-
end
6447
end

test/test_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def log_in_as(user)
1919
OmniAuth.config.mock_auth[:github] =
2020
OmniAuth::AuthHash.new({
2121
:provider => 'github',
22-
:uid => user.id,
22+
:uid => user.uid,
2323
:credentials => {
2424
:token => 'mock_token',
2525
:active_member => 'mock_active_member'

0 commit comments

Comments
 (0)