RailsApps / rails3-devise-rspec-cucumber

An example Rails 3.2 app with Devise and RSpec and Cucumber.
http://railsapps.github.io/
445 stars 144 forks source link

i use warden to test but have this error ? #43

Open vissul opened 11 years ago

vissul commented 11 years ago

@user = FactoryGirl.create(:user, email:"gvissul@gmail.com") login_as @user

SQLite3::BusyException: database is locked: UPDATE "users" SET "last_sign_in_at" = '2013-02-28 23:50:24.881571', "current_sign_in_at" = '2013-02-28 23:50:24.881571', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2013-02-28 23:50:24.883425' WHERE "users"."id" = 1

DanielKehoe commented 11 years ago

What happens if you make this change:

@user = FactoryGirl.create(:user, @visitor)
vissul commented 11 years ago

it does not work i think its a session problem ?

vissul commented 11 years ago

should i use include Warden::Test::Helpers or devise helper to login or sign_in ?

vissul commented 11 years ago

i can not find why database is locked ?

DanielKehoe commented 11 years ago

Take a look at the tutorial: http://railsapps.github.com/tutorial-rails-devise-rspec-cucumber.html

I don't know what is going on for you. It is a local issue. Try:

$ rake db:reset
$ rake db:test:prepare
vissul commented 11 years ago

when i use warden login user i got a database locked ,because it will update user table when use sign

vissul commented 11 years ago

and here is the test log

Connecting to database specified by database.yml (0.6ms) begin transaction (0.1ms) SAVEPOINT active_record_1 User Exists (0.2ms) SELECT 1 AS one FROM "users" WHERE "users"."email" = 'gvissul1@gmail.com' LIMIT 1 Binary data inserted for string type on column encrypted_password SQL (0.7ms) INSERT INTO "users" ("confirmation_sent_at", "confirmation_token", "confirmed_at", "created_at", "current_sign_in_at", "current_sign_in_ip", "email", "encrypted_password", "job", "last_sign_in_at", "last_sign_in_ip", "mobile", "name", "office", "officeno", "parent_id", "remember_created_at", "reset_password_sent_at", "reset_password_token", "sign_in_count", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ["confirmation_sent_at", nil], ["confirmation_token", nil], ["confirmed_at", Fri, 01 Mar 2013 00:05:36 UTC +00:00], ["created_at", Fri, 01 Mar 2013 00:05:37 UTC +00:00], ["current_sign_in_at", nil], ["current_sign_in_ip", nil], ["email", "gvissul1@gmail.com"], ["encrypted_password", "$2a$04$PTP0dt6kLFEwaRmHU.6Ofu7KYU47hCi3zknl1x5yws5xhWvCzxV4S"], ["job", nil], ["last_sign_in_at", nil], ["last_sign_in_ip", nil], ["mobile", nil], ["name", "wanglei"], ["office", nil], ["officeno", nil], ["parent_id", 0], ["remember_created_at", nil], ["reset_password_sent_at", nil], ["reset_password_token", nil], ["sign_in_count", 0], ["updated_at", Fri, 01 Mar 2013 00:05:37 UTC +00:00] RELEASE SAVEPOINT active_record_1 Started GET "/users/sign_in" for 127.0.0.1 at 2013-03-01 08:05:38 +0800 (0.5ms) begin transaction (0.2ms) UPDATE "users" SET "last_sign_in_at" = '2013-03-01 00:05:38.587664', "current_sign_in_at" = '2013-03-01 00:05:38.587664', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2013-03-01 00:05:38.590087' WHERE "users"."id" = 1 SQLite3::BusyException: database is locked: UPDATE "users" SET "last_sign_in_at" = '2013-03-01 00:05:38.587664', "current_sign_in_at" = '2013-03-01 00:05:38.587664', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2013-03-01 00:05:38.590087' WHERE "users"."id" = 1 (0.0ms) rollback transaction (0.2ms) rollback transaction

DanielKehoe commented 11 years ago

I can't help with Warden test issues, sorry.

vissul commented 11 years ago

thats ok ,thank u all the same

schadenfred commented 11 years ago

If you push your code up to github I might be able to figure it out.

On Thu, Feb 28, 2013 at 4:11 PM, wang lei notifications@github.com wrote:

thats ok ,thank u all the same

— Reply to this email directly or view it on GitHubhttps://github.com/RailsApps/rails3-devise-rspec-cucumber/issues/43#issuecomment-14266125 .

marvincayetano commented 6 years ago

To some people who are having this problem. Try closing your rails console