|
962 | 962 |
|
963 | 963 | it 'registers an offense when using `assert_response` with a number' do |
964 | 964 | expect_offense(<<~RUBY) |
965 | | - assert_response 200 |
966 | | - ^^^^^^^^^^^^^^^^^^^ Use `expect(response).to have_http_status(200)`. |
| 965 | + assert_response 302 |
| 966 | + ^^^^^^^^^^^^^^^^^^^ Use `expect(response).to have_http_status(302)`. |
967 | 967 | RUBY |
968 | 968 |
|
969 | 969 | expect_correction(<<~RUBY) |
970 | | - expect(response).to have_http_status(200) |
| 970 | + expect(response).to have_http_status(302) |
971 | 971 | RUBY |
972 | 972 | end |
973 | 973 |
|
|
985 | 985 | it 'registers an offense when using `assert_response` with ' \ |
986 | 986 | 'failure message' do |
987 | 987 | expect_offense(<<~RUBY) |
988 | | - assert_response :ok, "expected OK status" |
989 | | - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `expect(response).to(have_http_status(:ok), "expected OK status")`. |
| 988 | + assert_response :success, "expected success status" |
| 989 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `expect(response).to(have_http_status(:success), "expected success status")`. |
990 | 990 | RUBY |
991 | 991 |
|
992 | 992 | expect_correction(<<~RUBY) |
993 | | - expect(response).to(have_http_status(:ok), "expected OK status") |
| 993 | + expect(response).to(have_http_status(:success), "expected success status") |
994 | 994 | RUBY |
995 | 995 | end |
996 | 996 |
|
997 | 997 | it 'registers an offense when using `assert_response` with ' \ |
998 | 998 | 'multi-line arguments' do |
999 | 999 | expect_offense(<<~RUBY) |
1000 | | - assert_response(:ok, |
1001 | | - ^^^^^^^^^^^^^^^^^^^^ Use `expect(response).to(have_http_status(:ok), "expected OK status")`. |
1002 | | - "expected OK status") |
| 1000 | + assert_response(:redirect, |
| 1001 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^ Use `expect(response).to(have_http_status(:redirect), "expected redirect status")`. |
| 1002 | + "expected redirect status") |
1003 | 1003 | RUBY |
1004 | 1004 |
|
1005 | 1005 | expect_correction(<<~RUBY) |
1006 | | - expect(response).to(have_http_status(:ok), "expected OK status") |
| 1006 | + expect(response).to(have_http_status(:redirect), "expected redirect status") |
1007 | 1007 | RUBY |
1008 | 1008 | end |
1009 | 1009 |
|
|
0 commit comments