Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vissul opened this issue Feb 28, 2013 · 11 comments
Open

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

vissul opened this issue Feb 28, 2013 · 11 comments

Comments

@vissul
Copy link

vissul commented Feb 28, 2013

@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

@DanielKehoe
Copy link
Member

What happens if you make this change:

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

@vissul
Copy link
Author

vissul commented Feb 28, 2013

it does not work i think its a session problem ?

@vissul
Copy link
Author

vissul commented Feb 28, 2013

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

@vissul
Copy link
Author

vissul commented Mar 1, 2013

i can not find why database is locked ?

@DanielKehoe
Copy link
Member

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
Copy link
Author

vissul commented Mar 1, 2013

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

@vissul
Copy link
Author

vissul commented Mar 1, 2013

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

@DanielKehoe
Copy link
Member

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

@vissul
Copy link
Author

vissul commented Mar 1, 2013

thats ok ,thank u all the same

@schadenfred
Copy link
Contributor

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//issues/43#issuecomment-14266125
.

@marvincayetano
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants