similar to: Rails Functional Testing Problem

Displaying 20 results from an estimated 1000 matches similar to: "Rails Functional Testing Problem"

2010 Jul 28
1
paperclip, authlogic and callback issue
I use authlogic for authentication and paperclip for handling user''s profile picture attachments. I use the following method to get the current_user def current_user_session return @current_user_session if defined? (@current_user_session) @current_user_session = UserSession.find end def current_user return @current_user if defined?(@current_user)
2011 Jun 09
8
Fail to call
Hi, I''m trying create a user system for a future project but I have a problem when I want give to my users the "Welcome". This is my code: #application_controller class ApplicationController < ActionController::Base protect_from_forgery helper_method :current_user private def current_user_session return @current_user_session if defined?(@current_user_session)
2009 Oct 18
4
NoMethodError in User sessionsController#new
I''m setting up authentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for
2011 Jun 01
7
desperate, errors with file upload
hello, i implementing a file upload using paperclip plugin. i getting the following error [1] when uploading a file. I''m using the gems rails v2.3.8 and paperclip v2.1.6. the parameter hash looks like [2], the model like [3]. Interesting is that i get two different errors, on the localhost with webrick it says: Status: 500 Internal Server Error no marshal_dump is defined for class
2009 Oct 28
1
Authlogic Page View Authentication Help
Hi: I am a newbie at ROR, and I am grasping my head around Authlogic. I am having hard time trying to figure out how can I do the following: in my application controller I have the following helpers: filter_parameter_logging :password, :password confirmattion helper_method :all private def current_user_session return @current_user_session if defined? (@current_user_session)
2008 Dec 16
20
step definitons to check login
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private def require_user unless current_user store_location flash[:notice] =
2010 Oct 30
3
Authlogic not active
Trying to add authlogic in a simple project but get the error; Showing app/views/layouts/application.html.erb where line #33 raised: undefined method `underscore'' for nil:NilClass Extracted source (around line #33): 30: <div id="mainleft"> 31: <ul class="menu"> 32: <li><%= nav_link "Home", "site", "index"
2007 Sep 10
6
RSpec view spec writing problem (unable to generate url_for in RESTful resource link_to)
Thanks, first, to everyone who''s asked and answered questions on this list, and to the creators of RSpec - it is all very helpful. I''ve searched the mailing list, and had a couple 2hr googling sessions that didn''t help me find an answer. I''ve run into a problem getting my first non-trivial view spec to run. I get an error when trying to generate a link_to()
2012 Jun 26
2
Error with rake command
I am using Rails 2.3.8 application and when I enter rake command it gives following error : ms@ms-HP:~/OpenStreetView$ rake WARNING: ''require ''rake/rdoctask'''' is deprecated. Please use ''require ''rdoc/task'' (in RDoc 2.4.2+)'' instead. at /home/ms/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb rake
2011 Jun 29
6
RSpec with Rails 3.1rc4: spec test won't recognize <%= %> (should be simple)
In my user_sessions_controller: class UserSessionsController < ApplicationController before_filter :require_no_user, :only => [:create, :new] before_filter :require_user, :only => :destroy def new @user_session = UserSession.new @message = "Hello." end def create @user_session = UserSession.new(params[:user_session]) if @user_session.save
2010 Nov 14
5
Authlogic and rails 3 : NameError in User sessionsController#new
Hi everybody, I''ve installed Authlogic on Rails 3 following the Railscast (http:// railscasts.com/episodes/160-authlogic), and the resources I was able to find on the web, but I''m facing a problem. Once I''ve generated the user_sessions controller and mapped the login and logout routes, I get an error if I try to load the login page : uninitialized constant
2010 Jul 19
6
Setting a root_url
I know how to setup a roo_url using map.root in "routes.rb". The issue I''m currently having is as follows: I walking through this Rails cast regarding Authlogic: http://railscasts.com/episodes/160-authlogic I decided that I make my map.root the "login" page, that is, the index.html.erb of the user_sessions_controller. So, what I did is typed the following in the
2009 Dec 25
18
rescue_from ActionController::RoutingError II
OK ... so I''m not supposed to use it but ... Why doesn''t rescue_from ActionController::RoutingError work witht he code from http://www.rubyplus.org/episodes/20-Extended-RESTful-Authentication-Rails-2-App.html class ApplicationController < ActionController::Base helper :all # include all helpers, all the time # See ActionController::RequestForgeryProtection for details
2008 Jul 07
3
How to get a users screen name into a hidden field in a PostsController action?
Instead of the user entering a name, I want to pass their screen name along with supplied :title and :content fields. here is what I''ve got.. f.hidden_field :author, user.screen_name here is the create method from Posts controller: def create @title = "Gravity" @user = User.find(params[:id]) # this does not work, and I don''t know why if request.post?
2010 Oct 21
4
Authlogic + Rails3 - undefined method `Login' for nil:NilClass
Im new to Rails, and decided to start of with Rails3. After a lot of searching ive managed to get a little bit of Authlogic working. I''m able to register a user, login & logout. Now, I would like to add more features, get more of authlogic working. I''m using Railscast EP 160 as my reference. Portions of the code found on the tutorial throw errors: Eg: <!--
2009 Sep 24
13
Rails Authentication Tutorial
Does anyone know a good authentication tutorial they can suggest? I''ve tried several restful authentication ones and an authlogic one on RailsCast. But with each one I try, something seems to be missing in the tutorial and I can''t get it to work. I''m new to Rails so it''s possible user error on my part. I''m on Mac OS X 10.5 and I generate all my apps in
2011 Jul 30
22
Question about Helpers
Studying the RoR 3 Tutorial book by Michael Hartl and on page 345 there''s the code inside the SessionsHelper: _________________________________________________________ module SessionsHelper def sign_in(user) cookies.permanent.signed[:remember_token] = [user.id, user.sault] self.current_user = user end end __________________________________________________________ What is the purpose
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated current_user in a model? Is there some sort of include or require I can do some where that would allow this? ********************************************************** Here is what I am trying to do: ********************************************************** class Setting < ActiveRecord::Base before_create :created_by_user #
2009 Sep 16
5
piece of code that runs only once
hi, an strange error is happening here in User model i have the following method: def falta_votar Category.find(:all) - votes.collect {|v| v.category} end and in the default.html.erb layout i have: <%= current_user.falta_votar.size %> but it only works once, when i try to access another page i get an error message saying that the falta_votar method is nil, then i have to restart
2010 Apr 16
4
DEEEEPLY nested
Hello, i have "a" has many "b", "b" has many "c", and "c" has many "d" Now... "d" is a user model, and I have a current_user helper method defined. If i navigate to an "a" show page, how can I make sure that my current_user ("d") is part of that "a"? meaning how can i make sure that