###行っていること
Ruby on Rails Tutorialが4.2対応の第3版を公開したので、
復習を兼ねてやっているのですが、
第9章演習3の「Web経由でadmin属性を変更できないことを確認するtestを書く」が成功しません。
重要な問題であるため、分かる方が居ましたら回答宜しくお願いします。
###ソースコード
require 'test_helper' class UsersControllerTest < ActionController::TestCase def setup @user = users(:michael) @other_user = users(:archer) end . . . test "should redirect update when logged in as wrong user" do log_in_as(@other_user) patch :update, id: @user, user: { name: @user.name, email: @user.email } assert_redirected_to root_url end test "should not allow the admin attribute to be edited via the web" do log_in_as(@other_user) assert_not @other_user.admin? patch :update, id: @other_user, user: { password: FILL_IN, password_confirmation: FILL_IN, admin: FILL_IN } assert_not @other_user.FILL_IN.admin? end . . . end
###エラー内容
bundle exec rake test実行→
NameError: uninitialized constant UsersControllerTest::FILL_IN
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2015/10/25 05:13