いつもお世話になっております。
Ruby on Rails Tutorial 8章でauthentication_pages_specが
エラーとなってしまい、それ以降を実行することができません。
おそらく実行ページ先が見つかっていないのかと思いますが、
チュートリアル通りには従っているはずなので困っています。
どうかお助けくださいませ。
-
Authentication signin with invalid information
Failure/Error: before { visit signin_path }
ActionView::Template::Error:
SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1./app/helpers/sessions_helper.rb:20:in `current_user'
./app/helpers/sessions_helper.rb:11:in `signed_in?'
./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980'
./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980'
./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
-
Authentication signin with invalid information
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with invalid information after visiting another page
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with valid information
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with valid information
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with valid information
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with valid information
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
- Authentication signin with valid information followed by signout
Failure/Error: before { visit signin_path } ActionView::Template::Error: SQLite3::SQLException: no such column: users.remember_token: SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' LIMIT 1 # ./app/helpers/sessions_helper.rb:20:in `current_user' # ./app/helpers/sessions_helper.rb:11:in `signed_in?' # ./app/views/layouts/_header.html.erb:9:in `_app_views_layouts__header_html_erb___2063214517191558985_70216852545980' # ./app/views/layouts/application.html.erb:12:in `_app_views_layouts_application_html_erb___3393450340642813266_70216830195980' # ./spec/requests/authentication_pages_spec.rb:8:in `block (3 levels) in <top (required)>'
◼︎ authentication_pages_apec.rb
lang
1require 'spec_helper' 2 3describe "Authentication" do 4 5 subject { page } 6 7 describe "signin" do 8 before { visit signin_path } 9 10 describe "with invalid information" do 11 before { click_button "Sign in" } 12 13 it { should have_title('Sign in') } 14 it { should have_selector('div.alert.alert-error', text: 'Invalid') } 15 16 describe "after visiting another page" do 17 before { click_link "Home" } 18 it { should_not have_selector('div.alert.alert-error') } 19 end 20 end 21 22 describe "with valid information" do 23 let(:user) { FactoryGirl.create(:user) } 24 before do 25 fill_in "Email", with: user.email.upcase 26 fill_in "Password", with: user.password 27 click_button "Sign in" 28 end 29 30 it { should have_title(user.name) } 31 it { should have_link('Profile', href: user_path(user)) } 32 it { should have_link('Sign out', href: signout_path) } 33 it { should_not have_link('Sign in', href: signin_path) } 34 35 describe "followed by signout" do 36 before { click_link "Sign out" } 37 it { should have_link('Sign in') } 38 end 39 end 40 end 41end
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/07/12 06:19
2015/07/12 07:52
2015/07/15 16:07