Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:12:35+00:00 2026-05-25T15:12:35+00:00

Hello when run rake test:functionals, here’s what I get on the shell : 1)

  • 0

Hello when run rake test:functionals, here’s what I get on the shell :

1) Failure:
test_should_create_client(ClientsControllerTest) [test/functional/clients_controller_test.rb:20]:
    "Client.count" didn't change by 1.
    <2> expected but was
    <1>.

    7 tests, 9 assertions, 1 failures, 0 errors
    rake aborted!
    Command failed with status (1): [/System/Library/Frameworks/Ruby.framework/...]

and this is what I have on line 20 in the clients_controller_test.rb file:

 test "should create client" do
    assert_difference('Client.count') do
      post :create, :client => @client.attributes
    end   

Please can anyone tell me where the problem comes from?

Thank you so much nathanvda!!!!

I have pass the attributes to the test and it works.Here’ the following code

  test "should create client" do
    assert_difference('Client.count') do
      post :create, :client => {:name => 'jeff', :adress => 'ter', :city => 'ny', 
                    :email =>'get@yahpp.fr', }
    end
    assert_redirected_to client_path(assigns(:client))
    assert_equal 'Client was successfully created.', flash[:notice]
  end

Here’s what I get after rake:test:functionals:

Finished in 0.292246 seconds.

7 tests, 11 assertions, 0 failures, 0 errors
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:12:36+00:00Added an answer on May 25, 2026 at 3:12 pm

    Probably, due to some validation error in the attributes you pass to the controller, there was no new client created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class Test extends Thread{ public void hello(String s){ System.out.println(s); } public void run(){
Failed to get Erlang re work for multiline, please help! > re:run(hello,\nworld, o,.*w, [multiline]).
hi when i run hello Android test http://developer.android.com/resources/tutorials/testing/helloandroid_test.html i got the following errors java.lang.RuntimeException:
Duplicate: Run .NET exe in linux Hello, Is it possible to make my existing
I'm trying to run through the Hello World tutorial for the iPhone and i
So I'm trying to run my first hello world prog written in C. I
I have a simple PHP app that prints 'hello world'. When I run it
Hello I am compiling a program with make but I get the error of
I'm attempting to get my first hello world rails example going using the rails'
Hello I get this error when I do cap deploy:cold. * executing cd /var/www/myapp.no/releases/20100905130830;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.