I am trying to verify that mine successfully creates a new user after logging in (using authlogic). Ive added some new fields to the user, so I just want to make sure that the user is saved correctly.
The problem is that by creating a valid factory user, whenever I try to grab its attributes for publication in the create method, the password and password confirmation are omitted. I presuem is a security method that authlogic runs in the background. This leads to test failures and test failure.
I am wondering how can I get around this problem? I could just type the attributes manually, but that doesn't seem very dry.
context "on POST to :create" do context "on posting a valid user" do setup do @user = Factory.build(:user) post :create, :user => @user.attributes end should "be valid" do assert @user.valid? end should_redirect_to("users sentences index page") { sentences_path() } should "add user to the db" do assert User.find_by_username(@user.username) end end
source share