# Authlogic & password problems using rspec

**URL:** <https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292>\
**Category:** Rails\
**Created:** [June 30, 2009, 4:53am UTC](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292 "2009-06-30T04:53:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoann-Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/59ef9b/32.png) [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Post date:** [June 30, 2009, 4:53am UTC](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292/1 "2009-06-30T04:53:55Z")

</div>

Hi,

I have a problem using rspec with my rspec tests with my application.  
I used authlogic to create my athentication system, following the  
video on railscast. It works fine with cucumber, but I always have a  
problem with rspec :

ActiveRecord::StatementInvalid in ‘ApplUsersController new action  
should render new template’  
SQLite3::SQLException: table appl\_users has no column named password:  
INSERT INTO “appl\_users” (“created\_at”, “updated\_at”, “username”,  
“id”, “password”, “email”) VALUES (‘2009-06-29 23:01:48’, ‘2009-06-29  
23:01:48’, ‘MyString’, 996332877, ‘MyString’, ‘MyString’)

In my spec file it is related to these lines :

it “new action should render new template” do  
get :new  
response.should render\_template(:new)  
end

I think it is because of my migration file but I’m really not sure

def self.up  
create\_table :appl\_users do |t|  
t.string :username  
t.string :email  
t.string :crypted\_password  
t.string :password\_salt  
t.string :persistence\_token  
t.timestamps  
end  
end

could you help me please?  
Thanks by advance

-Yoann-Z

---

<div class="post-metadata">

**Author:** ![Yoann-Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/59ef9b/32.png) [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Post date:** [June 30, 2009, 6:20am UTC](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292/2 "2009-06-30T06:20:22Z")

</div>

On Mon, Jun 29, 2009 at 4:06 PM, Yoann-Z [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> SQLite3::SQLException: table appl\_users has no column named password:
> 
> ```
> t.timestamps
> 
> ```
> 
> end  
> end
> 
> could you help me please?  
> Thanks by advance
> 
> -Yoann-Z

Yoann, you’re using crypted\_password field in your migration but you’re  
trying to  
insert into a table using the field, password.

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![Yoann-Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/59ef9b/32.png) [@Yoann-Z](https://www.ruby-forum.com/u/Yoann-Z)\
**Post date:** [July 5, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/authlogic-password-problems-using-rspec/171292/3 "2009-07-05T18:58:40Z")

</div>

doh, i ran into same problem. the fixture was generated with the now  
invalid password column. simply delete it

$ rm test/fixtures/users.yml
