Displaying 20 results from an estimated 800 matches similar to: "Upgrading from 3.2.0 to 3.2.1: Wrong Number of Arguments"
2012 Jun 14
3
response.should have_content("1 movie") does not seem to work for me
Hey everybody
I have worked quite to near the end of The RSpec Book, but now I''m
having some troubles.
I''m trying to get the last few Cucumber steps to work, which are:
Then /^Caddyshack should be in the Comedy genre$/ do
visit genres_path
click_link "Comedy"
save_and_open_page
response.should have_content("1 movie")
response.should
2007 Jan 26
0
Problems with assert_select in integration tests
I''ve been battling with assert_select in my integration tests for
several evenings now. I''m testing a multi-step form, and after
submitting the first step, my assert_selects fail on the attempts to
find the form on the next page. However if I print out the response
object, it has the exact text of what I''m trying to match.
Here is the complete integration test. The
2012 Jun 14
1
Cucumber/RSpec ::: Capybara? Webrat What am I using??
Hey everybody
I''m currently reading through the Pragmatic Programmers RSpec book, and
I really enjoy it.
But I’m facing some problems because of the fact that the book is
already some years old, I guess. I have installed rvm and use Ruby
1.9.3, and I didn’t really get some Rails code examples to work
properly, so I tried it with a 1.8.7 installation, but there I had some
other problems
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
2009 Jan 09
1
Is there a problem with webrat?
webrat (0.3.4)
I have this in the view:
<div id="list_entity_1">
<tr>
<td>Just An Entity</td>
<td>000001</td>
<td id="show_entity_1"><a href="/entities/1">Show Entity</a></td>
<td id="edit_entity_1"><a href="/entities/1/edit">Edit
Entity</a></td>
2009 Mar 13
2
[webrat] click link by title doesn''t work
Webrat 0.4.2 doesn''t seem to allow you to click links by title. Am I missing
something stupid?
With steps below running in sequence, first passes, second fails
Then /^I should see a view (\w+) details link$/ do |object|
response.should have_tag("a[title=#{object}_details]")
end
When /^I follow view (\w+) details link$/ do |object|
click_link "#{object}_details}"
2010 Aug 13
2
Rails 3 / ActiveModel for Credit Card information?
When submitting billing information in the past I''ve always used
attr_accessor for credit card details as they should not be saved in
the database. In addition I always end up storing the card
expiration date so that the date form helper works correctly.
With Active Model it seems logical to create a CreditCard class to
hold this data instead.
**1st issue.**
It seems there still
2012 Aug 05
0
ActiveRecord::Validator vs ActiveModel::Validator
I know that there is an ActiveModel Validator class
https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validator.rb
which is used for the class level validation macros.
But I didn''t find a an ActiveRecord Validator class.
From my understanding in Rails 3, validations have been moved into
ActiveModel to leave ActiveRecord as an ORM.
So now I see this Rails 3 code
2012 Sep 03
0
undefined method `singular_route_key' for "User":ActiveModel::Name
In ActionDispatch::PolymorphicRoutes, there is a call to
build_named_route_call an on line 172 (of latest rails code from
github), there is a call to singular_route_key:
model_name_from_record_or_class(parent).singular_route_key
Now model_name_from_record_or_class returns an ActiveModel::Name
object, which is a wrapper to the string class, that returns a string
name of the class of an
2012 Sep 25
3
Proposal for a new ActiveModel::Errors structure
There are few issues with the current ActiveModel::Errors class.
Firstly, when an error is added to ActiveModel::Errors class via #add
method
(https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L294)
its translation is added. It should not be translated when being added, but
only when being read.
The second issue is a bit bigger. We''d like to create
2013 Feb 08
1
Problem with many to many relationship
Hi
I''m trying to create a many to many relationship between two models.
A User can be associated with many Incidents and vice versa.
class User < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :incident_participants, foreign_key: "participant_id"
has_many :participated_incidents, through: :incident_participants
end
class Incident
2013 Aug 26
2
linkedin login using omniauth
Hi,
I am trying to add linkedin login feature in my rails application using
omniauth gem..I used omniauth gem for Fb login and it''s working fine..but
it''s not working for linkedin login
this is my code
/model/user.rb
class User < ActiveRecord::Base
attr_accessible :name, :oauth_expires_at, :oauth_token, :provider, :uid
def self.from_omniauth(auth)
2013 Nov 22
2
Cancan Rspec load_and_authorize_resource
Hello!
While running bundle exec rake, I receive following error (see in
attached file)
However, my tests are steel passing with command rspec spec/controllers/
Some info:
ads_controller.rb:
class AdsController < ApplicationController
load_and_authorize_resource except: :create
end
ads_controller_spec.rb:
require ''spec_helper''
describe AdsController do
render_views
2007 Dec 23
3
InvalidAuthenticityToken problems with my login form
I am trying to convert my codeand to use the new Rails 2.0 feature
RequestForgeryProtection
but I get an InvalidAuthenticityToken error, right from the beginning
with my login form..
I followed the recommandations :
in my environment.rb
config.action_controller.session = {
:session_key => ''myappname'',
:secret =>
2013 Jun 23
1
Contact form - NoMethodError (undefined method `each' for nil:NilClass)
Hi Guys,
So basically I want a contact form to appear on all the service pages.
I''ve already created a contact form for the contact page which works
perfectly using this tutorial:
http://matharvard.ca/posts/2011/aug/22/contact-form-in-rails-3/
Now I would like to implement this approach on the service pages, and it
works until I push the Submit button, when I get the following error:
2012 Sep 18
2
undefined method `to_sym' for nil:NilClass
Hi all,
I am trying to upgrade my rails 2 app to 3 and am getting this error
when trying to login:
NoMethodError in AuthenticateController#authenticate
undefined method `to_sym'' for nil:NilClass
The stack trace is:
activerecord (3.2.2) lib/active_record/validations/uniqueness.rb:26:in
`validate_each''
activemodel (3.2.2) lib/active_model/validator.rb:153:in
2013 Oct 23
0
Error: allocator undefined for Proc
I had this problem all of a sudden, just changed some puppet classes in my
modules, but no particular stuff or no error in the catalog creation.
Env :
Puppet master version 3.2.0-rc1
Centos kernel 2.6.32-279.11.1.el6.x86_64
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
Info: Caching catalog for jbossvdbmaster.prod.italy.cloudlabcsi.eu
Debug: Searched for resources in 0.01 seconds
Debug:
2012 Jul 21
0
undefined method `scope' for non ActiveRecord class
I am trying to use the geocoding capabilities into a table less
model , but the method :scope is not defined ..
is there a way to include it ?
class SearchLocation
require ''geocoder''
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
extend Geocoder::Model::ActiveRecord # extending the class w
geocoding capaibilities ( from
2013 Feb 01
0
Add a customer renderer but I get missing template
Hi,
I''m trying to include the support of Msgpack<https://github.com/msgpack/msgpack-ruby> in
Rails 3.2 but when I try to return a mpac response, I get an error
concerning a missing template.
My renderer:
Mime::Type.register ''application/x-mpac'', :mpac
ActionController::Renderers.add :mpac do |mpac, options|
self.content_type ||= Mime::MPAC
2011 Feb 05
3
ActiveModel::AttributeMethods limiting
In my attempt to add AM:Dirty to my model I realized that
AM#AttributeMethods is a bit imperfect. It''s impossible to generate
attribute methods step-by-step in DataMapper-like manner.
class Model
include ActiveModel::Dirty
def self.property(name, klass = String)
define_property_accessors(name, klass)
# This method will be called once, because of