エンジニアとしての市場価値を測りませんか?PR

企業からあなたに合ったオリジナルのスカウトを受け取って、市場価値を測りましょう

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

テストコードエラー

Posted at

<エラー文>

Failures:

  1) 職員による自分のアカウント管理 更新 email属性を変更する
     Failure/Error: expect (staff_member.email).to eq("test@example.com")
     
     ArgumentError:
       bad value for range
     # ./spec/requests/staff/my_account_management_spec.rb:21:in `block (3 levels) in <top (required)>'

Finished in 2.61 seconds (files took 7.83 seconds to load)
3 examples, 1 failure

<修正前>

my_account_management_spec.rb
example "email属性を変更する" do
      params_hash.merge!(email: "test@example.com")
      patch staff_account_url,
        params:{id: staff_member.id , staff_member: params_hash}
      staff_member.reload
      expect (staff_member.email).to eq("test@example.com")
    end

<修正後>

my_account_management_spec.rb
example "email属性を変更する" do
      params_hash.merge!(email: "test@example.com")
      patch staff_account_url,
        params:{id: staff_member.id , staff_member: params_hash}
      staff_member.reload
      expect(staff_member.email).to eq("test@example.com")  #ここを変更
    end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?