similar to: error with test:functionals

Displaying 20 results from an estimated 200 matches similar to: "error with test:functionals"

2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the method API to take a string param that is evaled in a lambda. http://dev.rubyonrails.org/changeset/6693 I much preferred the old API, since it''s simple enough to pass a lambda. Passing a string means the lambda is in the wrong scope and doesn''t have access to objects in the test case scope. For an
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read about it at http://blog.caboo.se/articles/2006/06/13/a-better- assert_difference and to some it should look familiar -- you know who you are :), so I took a shot at one for rSpec on Rails. class Object def should_be_different(method = nil, difference = nil) return self.should_not_eql(yield) if method.nil?
2012 Jan 18
3
Cannot redirect to nil!
I need some help please.. when I created web application about books market, i create a cart and using test the message error appear like this on rake test:functionals LineItemsControllerTest > test_should_create_line_item > ERROR > Cannot redirect to nil! and also appear on web side, thats error told that "Cannot redirect to nil!" Then i was checking the code,
2006 Aug 06
2
assert_difference gives undefined method error in unit tests
Hi there Am hitting undefined method errors for ''assert_difference'' in my unit tests under Rails 1.1.4 What could I be missing? Richard Sandilands
2007 Oct 17
1
Problem with assert_difference
Hello Friends, I have problem with assert_difference, I want its syntax and explantion in detail, Please help me, plz give me solution. Regards, Kiran Polawar --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2011 Aug 02
1
Rspec teting API.
Hi! Guys, I wanna test an API built in Rails 3.0.3. So, my question is... What''s the better way to test my own api? I guess that a requests specs like these: describe ''POST /client'' it ''works'' do assert_difference post ''/clients'', :client => {...} end end can be appropriate... Someone just tested an API? I mean... simulate
2009 Apr 21
2
validates_uniqueness_of
hello all, i am new to RoR programming and am struck with the functional test whole checking for uniqeness of carriers. If it is not unique,the the bin shudn''t be created.Can someone help me in correcting my code. def test_create_failure_cycle_unique begin num_bins = Bin.count post :create, {:bin => { :carrier => carriers(:A), :cycle => cycles(:one), :name =>
2008 Jul 17
2
problems with validation on STI
I have the following STI table: def self.up create_table :distributions do |t| t.string :type t.integer :simulation_id t.string :dist_name t.string :desc, :default=> ''fixed'' t.float :param1, :default => 5.0 t.float :param2, :param3 t.timestamps #fields for RscDist t.integer :resource_id #fields for LoadDist
2008 Dec 11
2
uninitialized constant ActionVie
Hello I am trying to transform my web app into a 2.2 ready app, in my config/environment.rb I wrote Rails::Initializer.run do |config| ..... # disabling the surrounding div if validation error ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| if html_tag.include?("class=") html_tag.sub(%r{(class=["''])}, ''\1invalid '')
2012 May 22
0
functional tests assert_difference with array
given a new partner instance and a new admin instance are created, what should be the difference number : +1 or +2 the doc is not so clear on it.... assert_difference [ ''Partner.count'', ''Admin.count'' ], +1 do... thanks for feedback -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to
2013 Sep 23
1
redirect on browser success, but redirect on functional test is error
line_items.yml: one: product_id: 1 cart_id: 1 quantity: 1 carts.yml: one: {} product.rb: has_many :line_items cart.rb: has_many :line_items, dependent: :destroy line_item.rb: belongs_to :product belongs_to :cart line_item_controller.rb: def destroy @line_item = LineItem.find(params[:id]) @cart = @line_item.cart @line_item.destroy respond_to do |format| format.html
2011 Jul 25
4
Rails 3 test database issues
I am having a problem using the test database in Rails 3. It apparently has kept track of aspects of the database that I deleted completely from my migrations at some point. I don''t always use the ''down'' part of a migration and sometimes just recreate the whole database. I did rake db:migrate:reset and rake db:test:prepare, but when I run my test it is trying to access
2010 Apr 05
1
`test': wrong number of arguments (1 for 2) (ArgumentError)
Hi, Im trying to change the syntax of my tests to the test "some method" do ... end syntax from the existing def test_some_method ... end syntax. Im pasting my test code below. Im getting the error in the subject line if I try to run the test as a ruby script from the console. require File.dirname(__FILE__) + ''/../test_helper'' require
2014 Feb 11
0
Cucumber test question
Hello all, I am trying to understand when I try to run a test in cucumber what I am missing that it is failing. I am using FactoryGirl to create my records and using cucumber to test my logic however I know that I am doing something wrong in my testing I just can't seem to figure out what. Here is what I have: Feature: Feature: All features related to staff info Scenario: notification
2008 May 13
0
assert_no_difference question
I have the following test code: assert_no_difference Avatar, :count do a = create_avatar(:description => nil) assert a.errors.on(:description) end further down, create_avatar looks like: def create_avatar(options = {}) Avatar.create(:description => "Foo Descr.").merge(options) end (Borrowed from the user test in acts_as_auth...) It seems to pass, as my avatar model
2008 Feb 05
1
Functional Test has error when testing controller updates_attribute of its parrent.
I am working in Rails 2.0 and I have the following functional test. class VotesControllerTest < ActionController::TestCase def test_should_create_vote assert_difference(''Vote.count'') do post :create, {:vote => {:vote_value => 5, :user_id => users(:nick).id, :entry_id =>
2008 Jan 16
0
[CruiseControl] RubyOnRails build 8649 failed
The build failed. CHANGES ------- Revision 8649 committed by gbuesing on 2008-01-16 20:07:10 Introducing DateTime #utc, #utc? and #utc_offset, for duck-typing compatibility with Time. Closes #10002 M /trunk/activesupport/CHANGELOG M /trunk/activesupport/lib/active_support/core_ext/date_time/calculations.rb M /trunk/activesupport/test/core_ext/date_time_ext_test.rb TEST FAILURES AND
2008 Jan 19
0
[CruiseControl] RubyOnRails build 8671 failed
The build failed. CHANGES ------- Revision 8671 committed by bitsweat on 2008-01-19 03:45:24 Support aggregations in finder conditions. Closes #10572. M /trunk/activerecord/test/cases/finder_test.rb M /trunk/activerecord/CHANGELOG M /trunk/activerecord/lib/active_record/aggregations.rb M /trunk/activerecord/lib/active_record/base.rb TEST FAILURES AND ERRORS -----------------------
2007 May 29
12
questions rspec on rails
Hi, rather than flooding this list with separate emails, I''ve been queueing up questions using rspec with rails. (an irc channel would be nice too :) Here ya go... - Is there a way to test named routes? - Could I get an example how to test an ajax request (link_to_remote)? would that go in view? and/or in controller spec? - Can you assert which layout template is rendered in a
2008 Jan 22
0
[CruiseControl] RubyOnRails build 8688 failed
The build failed. CHANGES ------- Revision 8688 committed by nzkoz on 2008-01-22 01:29:10 Add options missing from earlier changeset M /trunk/activerecord/lib/active_record/test_case.rb TEST FAILURES AND ERRORS ----------------------- Name: test_ordering(FirstSecondHelperTest) Type: Failure Message: <"first mail"> expected but was <"">.