[rspec-users] Validation Failed: Userkey has already been taken, Email has already been taken

2013-02-28 Thread ruby rails
Hi, I am using Factory girl with rspec and capybara for testing my rails appliction. I have the below code FactoryGirl.define do factory :user do |f| f.email "s...@gmail.com" f.userkey "12ssd345q62" end end When I run the test it is failing as "Validation Failed: Userkey has already been

[rspec-users] uninitialized constant Factory (NameError)

2013-02-28 Thread ruby rails
I have installed factory_girl_rails gem in Gemfile for both test as well as development. And in the password_rest_spec file I have given require 'spec_helper' describe "PasswordResets" do it "emails when user requesting password reset" do user = Factory(:user) #forget_pwd.userid.should ==

Re: [rspec-users] Testing Controllers in Rspec

2013-02-27 Thread ruby rails
guirec c. wrote in post #1099350: > I think your are confused with acceptance specs and controllers spec. In > a controller spec you must to test only your controller in total > isolation. You can use stubs and mocks to do it. In the acceptance spec > you must to test all the behaviour at a very hi

[rspec-users] Testing Controllers in Rspec

2013-02-27 Thread ruby rails
I am building an Rails application where the forgot password feature is implemented. I need to write the test cases for it using RSpec. I am very new to RSPEC and got the basic idea of how rspec works from the tutorial and screencasts. But I am not sure how it can be tested for controllers. In my c