similar to: Authenticating before tests

Displaying 20 results from an estimated 400 matches similar to: "Authenticating before tests"

2006 Apr 13
1
Model is not a class
I''m trying to specify a model in a controller, but rails gives me "Account is not a class", where Account is my model name ... This is my model: class Account < ActiveRecord::Base validates_presence_of :email, :email_confirmation, :username, :password, :password_confirmation validates_format_of :email, :with =>
2006 Jun 02
6
Set instance variable for all actions in the Controller
Can I set an application wide instance variable that is available for all actions...and their views? eg. class ApplicationController < ActionController::Base @current_user = User.find(session[:user_id]) end and everywhere I can call @current_user.id and I can get that object? Even down in the views? I could not get this to work... Thanks in advance, Jeff -------------- next part
2008 Jan 21
9
DRY act_as_authenticated functional testing
I''m using the acts_as_authenticated plug-in for my app. Now I need to get my functional tests to work properly. I have not written functional tests before so I''m unsure how to utilize setup so that all of my tests can use the login. My tests pass if I put login_as :user inside of each test, but that''s clearly not DRY. Can I add something to my test_helper.rb file or
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful controller (well, aren''t all RESTful controllers simple? :) I''ve created a couple spec helper methods to refactor some of the common code...for example, require_login_and_correct_user creates two specifications: one for when the user isn''t logged in, and one when the user is logged in but
2005 May 14
6
HELP!! Serious memory leak in my rails app!!
I''m having a huge memory leak problem with a rails application I''m developing! I first noticed that when running under webrick (via script/server) there was a fast memory leak.. several users using the app for a few hours would use 2 gig of memory!!! I searched the archives and found that some users found that it could be avoided by saying --daemon when launching webrick..
2007 Sep 22
2
Odd response.body behavior
Hi all, I''m having very odd behavior, but only with a few of my specs. I''m checking the value of response.body and in most cases finding it to be the content of the body... but in some cases it''s the name of the template rendered!! There''s no rhyme or reason I can see, but obviously my tests fail for no reason when I expect the body to contain the
2007 Mar 22
6
Anyone using Goldberg for production sites?
Just starting to look at Goldberg and I like what I see so far. However, there''s quite a bit in there. Anyone using Goldberg for production sites? How is the security, flexibility, etc? Thanks for any input you can provide! Jake --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2005 Oct 05
2
Transient Model Attributes in ActiveRecord
Hi all! I''ve been using an instance of my model to do "query by example".. Basically I fill in a new instance of the model and then later interrogate it to generate my conditions for find( :all ).. Where things get ugly is that I just moved several properties into a joined table, but I''d like to keep the ability to set those attributes in the original model..
2007 Feb 28
4
acts_as_authenticated error with Object#id
I''m getting this when I run my Rails controller specs. <projectroot>/config/../lib/authenticated_system.rb:16: warning: Object#id will be deprecated; use Object#object_id I added "include AuthenticatedTestHelper" to /spec/spec_helper.rb so that my controller tests^H^H^H^H^Hspecs can use the "login_as" helper method. Anyone know how to fix this? -- Cheers,
2005 Nov 27
3
Canvas Tag + Rails Ajax
Hi all, Just looking for a quick sanity check. I was thinking of writing a plugin for rails to give rails developers a good way of using the new firefox 1.5/safari canvas tags. I was thinking of grabbing an existing ruby graphics library and modifying it so that it renders via the canvas tag.. So you could have link_to_remote pointing to controller actions that instead of returning
2007 Jun 25
1
Functional tests and active scaffold: unexpected assertion failure.
Hello, I''m writing a functional test for a controller that uses active scaffold. def test_presence_of_field login_as(:peter) profile = Profile.find :first get :edit, {:id => profile.id} assert_response 200 assert_select "textarea#record_free_text_ec" end I was expecting the first ''assert 200'' to give me a green bar, but added it for
2003 Mar 19
3
SAMBA on the WAN
Is anyone routing samba connections over a wan? Is there a way to do this that will make the network admins happy? Thanks for your help with this. -alan ============================================== Alan M. Goldberg SAP Basis Specialist, Web Consultant HJ Heinz Company of Canada Ltd PH: 416-226-7542 FX:416-226-7564 CEL: 416-606-8945 PAG:416-381-0157 alan.goldberg@hjheinz.com
2007 Oct 11
2
Login testing ideas
I''ve been going through Pat''s example story and noticed that there was no checking for a bad login. I assume this is because that would have made the article bigger and more complicated than it needed to be. So the question that comes of of this is: How do folks normally handle the negative case? My plan was to just use another scenario, but as a new person to BDD/TDD,
2018 Jun 20
2
Welcome to the "Xapian-discuss" mailing list
Hi, I'm new to Xapian and wanted to know if it has a specific feature. I want to be able to check the relation between two terms on a page based on how close they are together on the page. I want to use a combination of n-gram based labeling and the "slop" feature found in Elasticsearch. Does Xapian have this/a similar feature? I haven't been able to find any programs that have
2008 Mar 20
5
sharing story steps
Hi, How can I have a common set of steps that all my stories share? i.e. My stories often start out looking like this: Given a user Joe Given a user Jordan then: Given("a user $username") do |username| @users ||= {} @user_sessions ||= {} @users[username] = create_user(:username => username) @user_sessions[username] = login_as(@users[username]) end I want to share that
2007 Jul 17
12
Getting past my login system
Thank you in advance for your help. I am relatively new to both Rails and Rspec and I am hoping for some insight from some experienced veterans. Right now I am using Rspec for code that has already been written so that additional functionality can be developed using the BDD method. My problem shows up when I try to spec controllers that are behind the login system. Each page checks for the
2008 Feb 22
2
Connecting to Oracle from Rails 2.0.2
Long afternoon, but finally got it. Hope this spares you some pain: Installation instructions mainly based on: http://ruby.about.com/od/enterprise/ss/ruby_oracle.htm Install Oracle Instant Client: mkdir C:\oracle cd c:\oracle Get the following files from here: http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html and unzip them into the c:\oracle\ unzip
2009 Nov 22
1
Metaplot Axis Annotation
Hello, We are looking to adjust the font size of the axis annotation on the graph that results from use of the metaplot() function. Metaplot seems to respond to cex and cex.lab to change those graphical parameters, but it doesn't respond to cex.axis. Is there a way to work around this by creating a customized x-axis, and if so, how? Thanks for all your help. Syntax is below. Best, Dawn
2008 Aug 09
6
ElderScrolls - case-sensitivity, many of the same file
hypothetically, i have 2 different textures, one names TX_Skin, another named tx_skin. a plugin calls TX_SKIN, which texture does it choose?
2006 Dec 01
4
uninitialized constant error in app but not when using console
I''ve got a wierd issue here and maybe someone can assist i created a module in my apps lib directory which i use for authenticating against an external source (among other things). lib/myapp.rb ----------------- require ''rubygems'' require_gem ''activerecord'' # uses activerecord odbc adapter by openlink module MyApp module ExternalSource class