{"issue":{"created_at":"2011-12-01T06:23:11Z","state":"closed","updated_at":"2011-12-01T06:26:13Z","comments":1,"user":{"gravatar_id":"386d133f10886f5aa7c44bb450eeb4f0","id":368254,"url":"https://api.github.com/users/railsfactory-dhibika","avatar_url":"https://secure.gravatar.com/avatar/386d133f10886f5aa7c44bb450eeb4f0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"railsfactory-dhibika"},"body":"describe GuardiansController do\r\n\t\r\n before(:each) do\r\n   @user_attr = Factory.attributes_for(:user)\r\n\t\t@current_user=User.create!(@user_attr)\r\n  end\r\n\r\n\r\nIn factories.rb\r\n\r\nFactory.define :user, :class => User do |a|\r\n\ta.email \"parent@gmail.com\"\r\n\ta.password \"123456\"\r\n\ta.password_confirmation  \"123456\"\r\n\ta.first_name \"user\"\r\n\ta.last_name \"user\"\r\n\ta.account_role \"Parent\"\r\n\ta.sign_in_count \"50\"\r\n\ta.current_sign_in_at \"2011-11-28 06:13:41\"\r\n\ta.last_sign_in_at \"2011-11-28 06:13:41\"\r\n\ta.current_sign_in_ip \"127.0.0.1\"\r\n\ta.last_sign_in_ip  \"127.0.0.1\"\r\n\tend\r\n\r\nBut when i execute rspec for this controller it shows error \r\nFailure/Error: @current_user=User.create!(@user_attr)\r\n     NoMethodError:\r\n       undefined method `destroyed?' for nil:NilClass\r\n\r\nHow i get the @current_user\r\n\r\n","assignee":null,"id":2411596,"labels":[],"number":1478,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"rspec-undefined method `destroyed?' for nil:NilClass","html_url":"https://github.com/plataformatec/devise/issues/1478","closed_at":"2011-12-01T06:26:13Z","url":"https://api.github.com/repos/plataformatec/devise/issues/1478","milestone":null},"action":"closed"}