similar to: setup method in functional tests and instance variables

Displaying 20 results from an estimated 700 matches similar to: "setup method in functional tests and instance variables"

2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody, I''m trying to test a little piece of code I wrote, and I get the following error: Exception: can''t dup Symbol It happens in the following line: try_to_login @valid_user, :remember_me => "1", where the function try_to_login is: def try_to_login(user, options = {}) user_hash = {:screen_name => user.screen_name, :password => user.password}
2009 Mar 03
6
Validation - set focus
hi, Is there any way to set focus in a particular field, after validation in rails?? or we have to use only javascript. For example., validates_presence_of :username (assume there is no username given) after validation, how can i set focus in that particular username textbox. is there any way in rails or should i use javascript. Thanks. -------- my ror blog http://www.srikanthjeeva.blogspot.com
2009 Mar 31
3
Accept POST data from external source?
Ok, this is harder than I thought. I''ve got a hunk of XML coming in from an entirely external source that I do not control (but another department in my company does, so it''s not like a giant security hole). I was hoping to just have them POST their data to me, and then I''d read the raw stream and parse it. I''m sure folks know what I ran into -- Invalid
2018 Sep 19
1
Sieve and output variable for execute
I'm trying to get blow Sieve filter to work require ["fileinto", "imap4flags", "mailbox", "body", "envelope", "vnd.dovecot.pipe", "variables", "vnd.dovecot.execute"]; if envelope :matches "To" "*@*" { set "recipient" "${0}"; set "user" "${1}"; set
2007 Dec 17
14
Change in isolation behaviour 1.08 - 1.10 ?
Hi, I just moved from 1.08 to 1.10 and now have one example failing, which, under 1.08, passed. Is the due to a change in behaviour? Here''s my spec (removed some passing examples) require File.dirname(__FILE__) + ''/../spec_helper'' describe "A user" do before(:each) do @user = User.new @valid_user = User.new( :email =>
2011 Jan 17
4
Factory Girl and attr_accessor with validation
I have a problem with a recent change to one of my models when created via Factory.create. class User < ActiveRecord::Base attr_accessor :tc_check validates :tc_check, :presence => true, :acceptance => true ... end The following definition fails, when calling Factory.create(:valid_user) Factory.define :valid_user, :class => User do |u| u.email
2009 Mar 23
6
PDFs prawn gem freeze into the app...
I was having great success with creating PDFs with prawn, I followed Ryan Bates latest screencast. All good. Trouble is when i come to deploy the app on my webhost I ran into trouble. Rails 2.3 app. I did, "sudo rake gem unpack prawn" to freeze it in. I put the app on my webhost but it won''t start, some error saying it can''t find prawn. Any ideas? (summary: works
2007 Mar 13
2
Authenticating with Active Directory
Hi all, I need to authenticate Active Directory users in Solaris. I wrote a program to do it using smbclient.a lib, but the method Valid_User is returning aways the code 1 (Network Error). The program is in attachment. When I use the following code, the user is sucessfully authenticated: smbclient '\\192.168.0.20\downloads' -W adteste -U dmadmin%Senha123 But, this command log in the
2009 Mar 26
2
send_file using AJAX
I have a AJAX based form and when I use send_file there is no pop-up that appears to prompt user to download file... how do I fix this? Regards, Sudhindra -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email
2009 Mar 17
1
Caching in Rails
I have a page that requires a lot of DB access to create a section of it, but that section does not change very often. I know how to cache the fragment in the view, but the db is still accessed in the controller. I watched the railscasts on fragment caching and he does it by moving the logic to the model. Is that the only way to do it? The part of the page that changes on every display is the
2008 Mar 01
0
Fixtures in ActionController::TestCase
Hi guys, Need some help. I am using Rails 2.0 and while writing functional test, I encountered the following problem class UserControllerTest < ActionController::TestCase fixtures :users ... def do_something attempt_login(users(:valid_user)) # assuming valid_user is a proper line in ... end def attempt_login(user) post :login, :user => { :login => user.login, :password
2009 Mar 10
5
onsubmit for remote_form_for not working properly
I want to use onsubmit for a form validation using javascript on remote_form_for for this i am doing something like this <% remote_form_for :timesheet, @timesheet, :url =>{:action => ''report_user''}, :html => {:onsubmit=>"return ValidateDate();" } do |f| %> // Form elements here <% end %> but it not works well. if condition return false
2011 May 25
1
warning: toplevel constant SomeController referenced by Admin::SomeController
This issue has been discussed before (http://www.ruby-forum.com/topic/ 125392) and after spending a while debugging through this, I still don''t have a solution. Lets try again? I have two controllers, SomeController and Admin::SomeController. When SomeController is loaded first (which happens under spork, found out by editing ActiveSupport::AbstractController) I get warning: toplevel
2006 Feb 06
1
Check, and display, AIM status on rails page
Thought I''d post this in case it''s of use to anyone. Maybe even a recipe? It''s just some simple helpers to show AIM status on a webpage. I searched before coding it, and didn''t find anything similar. Maybe that''s because it was so simple :) These methods belong in a helper (such as app/helpers/application_helper.rb) # begin AIM helper methods def
2008 May 09
4
Validating Uniqueness From Two Database Tables?
Well, I''m working on adding a new type of user (organization) to my application, using a different database table than the standard User table (in the end, I think it works out being easier to deal with than creating another column in the original User table for account type). However, I''m running into a user registration problem. I can register both types of users fine,
2020 May 29
2
LLVM Support needed
I wanted confirm answer from you guys. Request you to provide authentic information on this. Best Regards / Mit freundlichen Grüßen Minal Kulkarni Knorr Bremse Technology Center India Survey No.276, Village Mann, Hinjewadi, Phase II, Tal.Mulshi, Pune - 411 057. Maharashtra , India. Phone: +91 9028098122 Mobile: mailto:minal.kulkarni at knorr-bremse.com
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and often do: rake load_fixtures... ... in order to populate my development database with fun data. Now, with any HABTM relationship, there are failures, as there is no way to say "which" fixtures to load first. Within an actual functional or unit test case, you could simply load them in the proper order, but
2020 May 28
2
LLVM Support needed
Hello Dear Team, I wanted to know in which version of LLVM Tricore architecture is supported. I have LLVM 2.8 with me which has no support for Tricore. Basically I wanted to add Aurix target support. Could you please help me. Best Regards / Mit freundlichen Grüßen Minal Kulkarni Knorr Bremse Technology Center India Survey No.276, Village Mann, Hinjewadi, Phase II, Tal.Mulshi, Pune - 411
2003 Oct 31
1
What may be causing these errors?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 knorr smbd[5439]: [2003/10/31 10:27:02, 0] lib/util_sock.c:get_socket_addr(919) knorr smbd[5439]: getpeername failed. Error was Transport endpoint is not connected knorr smbd[5439]: [2003/10/31 10:27:02, 0] lib/util_sock.c:write_socket_data(388) knorr smbd[5439]: write_socket_data: write failure. Error = Connection reset by peer knorr smbd[5439]:
2006 Jun 17
3
What is this failure trying to tell me?
Here is my unit test code. post :login, :user=>{ :login => "bob", :password => "test"} assert_response :redirect assert_session_has :user assert_redirected_to :action => ''welcome'' Here is the failure I''m getting when I run my tests. 2) Failure: test_login_required(UserControllerTest)