Sha256: 6bfabfa5679d1e113e95ca34941b1ee3165835dac828520529cd822c5c82877d
Contents?: true
Size: 750 Bytes
Versions: 2
Compression:
Stored size: 750 Bytes
Contents
require "test_helper" class Sessions::SudosControllerTest < ActionDispatch::IntegrationTest setup do @<%= singular_table_name %>, @token = sign_in_as(<%= table_name %>(:lazaro_nixon)) @<%= singular_table_name %>.sessions.last.update! sudo_at: 1.day.ago end test "should sudo" do post sessions_sudo_url, params: { password: "Secret1*3*5*" }, headers: { "Authorization" => "Bearer #{@token}" } assert_response :no_content end test "should not sudo with wrong password" do post sessions_sudo_url, params: { password: "SecretWrong1*3" }, headers: { "Authorization" => "Bearer #{@token}" } assert_response :bad_request assert_equal "The password you entered is incorrect", response.parsed_body["error"] end end
Version data entries
2 entries across 2 versions & 1 rubygems