rails3-devise-rspec-cucumber icon indicating copy to clipboard operation
rails3-devise-rspec-cucumber copied to clipboard

i use warden to test but have this error ?

Open vissul opened this issue 12 years ago • 11 comments

@user = FactoryGirl.create(:user, email:"[email protected]") 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

vissul avatar Feb 28 '13 23:02 vissul

What happens if you make this change:

@user = FactoryGirl.create(:user, @visitor)

DanielKehoe avatar Feb 28 '13 23:02 DanielKehoe

it does not work i think its a session problem ?

vissul avatar Feb 28 '13 23:02 vissul

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

vissul avatar Feb 28 '13 23:02 vissul

i can not find why database is locked ?

vissul avatar Mar 01 '13 00:03 vissul

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

DanielKehoe avatar Mar 01 '13 00:03 DanielKehoe

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

vissul avatar Mar 01 '13 00:03 vissul

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" = '[email protected]' 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", "[email protected]"], ["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

vissul avatar Mar 01 '13 00:03 vissul

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

DanielKehoe avatar Mar 01 '13 00:03 DanielKehoe

thats ok ,thank u all the same

vissul avatar Mar 01 '13 00:03 vissul

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 [email protected] 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 .

schadenfred avatar Mar 01 '13 04:03 schadenfred

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

marvincayetano avatar Nov 17 '17 06:11 marvincayetano