Gitte Wange wrote:> Hello,
>
> I''m experiencing some odd behaviour with my database when I run my
> functional tests.
> I have an install controller which (as the name may reveal) handles
> installation of my app :-)
> What it does is that it installs the db schema so users only have to
> setup the db not needing to know how to actually install the schema.
> (for future releases it will also handle upgrades).
>
> The flow in the install method is as follows:
> install the db schema
> create an admin user from params supplied by the user
> install some basic objects i have
>
> When i run it under the test environment it does install the db.
> But the next steps (adding the user, creating the objects) never gets
> saved into the db. It performs it, but the test log reveals no trace of
> the data actually getting inserted.
> If I comment out the step of installing the db, my test acts as I expect
> it to.
>
> Any ideas why it won''t work?
Well I figured out that it might not be a db problem but a model
problem. I''m using the LoginController for handling users and when I do
a User.new(@params[:user]) it simply doesn''t create the object.
Drives me crazy.
Anyone knows if I cannot create a user from any other controller than
the user controller? (dunno why anyone would want tio limit it to that
but you never know ... )
--
Gitte Wange - http://mamatux.dk
Let those who love you, love you.
Those who do not love you, let God turn their minds.
If He cannot turn their minds, let him turn their ankles,
so that we might recognize them by their limping.