[Rails] Re: Rspec: expect(response).to have one of several valid values

2017-07-18 Thread Frederick Cheung
On Sunday, July 16, 2017 at 1:43:01 AM UTC+1, Ralph Shnelvar wrote: > > > expect(response).to (have_http_status(200) || have_http_status(302)) > > While syntactically valid, this doesn't work because > have_http_status(200)will > throw an exception before it gets to the have_http_status(302) .

[Rails] Re: Rspec. Is 302 a success? Why 302?

2017-07-15 Thread Frederick Cheung
On Friday, July 14, 2017 at 6:02:38 PM UTC+1, Ralph Shnelvar wrote: > I have the following code, which was automagically created, in > ~/controllers/articles_controller_spec.rb > > >   describe "GET #new" do >     it "returns a success response" do >       # See Hassan's answer in >       #  

[Rails] Re: Rspec. assert_select deprecated?

2017-07-14 Thread Frederick Cheung
On Friday, July 14, 2017 at 2:49:48 PM UTC+1, Ralph Shnelvar wrote: > So ... where can I find current documentation on assert_select? > > Is assert_select an Rspec facility or a wrapper around some other facility I > need to learn? > It was extracted from rails into the rails-dom-testing gem,

[Rails] Re: Rspec. assert_select deprecated?

2017-07-14 Thread Ralph Shnelvar
So ... where can I find current documentation on assert_select? Is assert_select an Rspec facility or a wrapper around some other facility I need to learn? If it isn't apparent, Fred, thank you. Ralph On Friday, July 14, 2017 at 5:15:04 AM UTC-6, Frederick Cheung wrote: > > > On Friday,

[Rails] Re: Rspec. assert_select deprecated?

2017-07-14 Thread Frederick Cheung
On Friday, July 14, 2017 at 9:58:56 AM UTC+1, Ralph Shnelvar wrote: > > So is it deprecated? What's it replaced by? Where can I find > documentation? > > apidock things things are deprecated when they move - it doesn't know it was extracted into the rails-dom-testing gem > I find no

[Rails] Re: Rspec failure with :get. :get documentation?

2017-07-10 Thread Frederick Cheung
On Sunday, July 9, 2017 at 9:55:30 AM UTC+1, Ralph Shnelvar wrote: > > > Questions: > > 1) Does the message "wrong number of arguments (given 2, expected 1)" refer > to get? > Yes > > 2) Where can I find documentation on get? I would start here:

Re: [Rails] Re: Rspec passes test only for one time

2016-06-21 Thread Deepak Sharma
On Tue, Jun 21, 2016 at 10:06 PM, wrote: > > > Alternatively, check out the database_cleaner gem. Thanks above gem works for me :) -- Cheers! Deepak Kumar Sharma Guru Nanak Dev Engineering College India! Blog: http://deekysharma.wordpress.com -- You received

[Rails] Re: Rspec passes test only for one time

2016-06-21 Thread jim
Your test database isn't being cleared after each test run. Normally this problem is solved by running each test in a transaction which is rolled back at the completion of each test. You can enable this in RSpec with the use_transactional_fixtures option. Alternatively, check out the

[Rails] Re: Rspec Testing issues -- Beginner Coder and not sure where to start in troubleshooting this.

2015-03-23 Thread dasibre
Can you passte your html/view code??? On Sunday, March 22, 2015 at 2:02:13 PM UTC-4, Shawn Wilson wrote: Im a noob to ROR and programming in general. i know enough to be dangerous but not enough to figure out where the hell i'm going wrong here. so this is what ive done so far. - wrote

[Rails] Re: Rspec for polymorphic classes

2014-09-26 Thread andreo
I am not sure I understand what you need, can you shows us your classes? It will be easier to answer your question if you give us your code maybe in a gist? On Thursday, 25 September 2014 23:51:03 UTC+2, Ruby-Forum.com User wrote: Factory Girl would be great too! Just a simple one will do!

[Rails] Re: Rspec for polymorphic classes

2014-09-26 Thread Jan Yo
class Address ActiveRecord::Base belongs_to :addressable, polymorphic: true end My Second Model: app/models/user.rb class User ActiveRecord::Base has_many :addresses, as: :addressable end My third model: app/models/company.rb class Company ActiveRecord::Base has_many

[Rails] Re: Rspec Active Record Problem

2014-09-25 Thread Matt Jones
On Wednesday, 24 September 2014 10:14:02 UTC-4, Ruby-Forum.com User wrote: Rspec forum isn't working Rspec is having trouble recognizing where method. Here's the rspec output: NoMethodError: undefined method `where' for #Article:0x00066ceb38 #

[Rails] Re: Rspec for polymorphic classes

2014-09-25 Thread Jan Yo
Factory Girl would be great too! Just a simple one will do! I woiuld like to test the derived class (not the polymorphic class). -- 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 unsubscribe

[Rails] Re: Rspec Active Record Problem

2014-09-24 Thread Jan Yo
Jason Fb wrote in post #1158388: Jan, That is pretty strange-- but it looks like you're doing something non-standard and you've gotten yourself into a pickle. I notice that the error message says there's no method 'where' on an instance of an Article. Normally you call where on the class

[Rails] Re: Rspec failing to find the model

2014-07-22 Thread Javix
On Tuesday, July 22, 2014 1:08:08 AM UTC+2, Sjouke Fikse wrote: I'm trying to create an instance of a class in a spec file, but I'm failing to do this. These two files exists: app/models/street.rb spec/models/street_spec.rb Within street_spec.rb, I'm trying to create a new

[Rails] Re: Rspec failing to find the model

2014-07-22 Thread Sjouke Fikse
Hi Javix, I did run rails generate rspec:install. I forgot to mention that. Here's the output of the files I mentioned: $ cat spec/models/street_spec.rb require spec_helper require street describe a street do it can be created do Street.new end end $ cat app/models/street.rb class

Re: [Rails] Re: Rspec failing to find the model

2014-07-22 Thread Serguei Cambour
You should remove the line 'require street'. On 22 July 2014 17:05, Sjouke Fikse sjouke.fi...@gmail.com wrote: Hi Javix, I did run rails generate rspec:install. I forgot to mention that. Here's the output of the files I mentioned: $ cat spec/models/street_spec.rb require spec_helper

[Rails] Re: Rspec failing to find the model

2014-07-22 Thread Javix
On Tuesday, July 22, 2014 1:08:08 AM UTC+2, Sjouke Fikse wrote: I'm trying to create an instance of a class in a spec file, but I'm failing to do this. These two files exists: app/models/street.rb spec/models/street_spec.rb Within street_spec.rb, I'm trying to create a new

[Rails] Re: Rspec testing in rails3

2014-04-26 Thread Frederick Cheung
On Saturday, April 26, 2014 4:09:15 PM UTC+1, Ruby-Forum.com User wrote: How do I test this in Rspec. I am pretty very new to Rspec. Please help. I tried like the below describe next do it routes /queues/:queue_id/next do { :get = /queues/regular_queue/next }.should

[Rails] Re: Rspec testing in rails3

2014-04-26 Thread ruby rails
Frederick Cheung wrote in post #1144184: On Saturday, April 26, 2014 4:09:15 PM UTC+1, Ruby-Forum.com User wrote: :format = json ) assigns(:queue).should_not be_nil expect(response).to be_success end But it is not at all coming inside my next

Re: [Rails] Re: RSpec vs. Cucumber

2013-09-07 Thread andreo
Hi Emil, Can you show me that example in cucumber but written in Rspec I been trying to solve that problem and dont seem to be able to send the parameters in json to the page using rspec + capybara. all the best, Andre -- You received this message because you are subscribed to the Google

Re: [Rails] Re: RSpec vs. Cucumber

2013-09-07 Thread Emil S
Andre, what you need is Rack::Test, not capybara. On 8 September 2013 03:54, and...@benjamin.dk wrote: Hi Emil, Can you show me that example in cucumber but written in Rspec I been trying to solve that problem and dont seem to be able to send the parameters in json to the page using rspec

[Rails] Re: RSpec vs. Cucumber

2013-08-27 Thread Lee Smith
My personal experience, of course, but the only time I'll ever write Cucumber features is if plain-english acceptance tests are a requirement. Otherwise (95% of the time), I'm quite happy with the RSpec/Capybara combo. The overhead of having to wire together plain-english to regular

Re: [Rails] Re: RSpec vs. Cucumber

2013-08-24 Thread Ilya Igonkin
On Sat, Aug 24, 2013 at 2:58 AM, Rekha Benada rekha.ben...@gmail.comwrote: Rspec is a popular framework for unit testing and Cucumber is used for integration testing and behavior driven development It's pretty strange to hear since RSpec description is BDD for Ruby. More than that, recent

Re: [Rails] Re: RSpec vs. Cucumber

2013-08-24 Thread Emil S
I'm a big fan of RSpec, and I use it all the time. But I think Cucumber wins hands down in generating readable test outputs which can be important in many scenarios. Let me explain one such scenario which I faced in one of my projects. I was working on a Rails API app which would serve as the

[Rails] Re: RSpec vs. Cucumber

2013-08-23 Thread Rekha Benada
Rspec is a popular framework for unit testing and Cucumber is used for integration testing and behavior driven development Unit tests with rspec confirm that small, discrete portion continue working as developers add features. Integration tests built with cucumber determine wether the

[Rails] Re: rspec rails 3 views authenticate

2013-05-27 Thread Aashish Kiran
unknown wrote in post #1110178: First thing, there is a forum here: https://groups.google.com/forum/?fromgroups#!forum/plataformatec-devise for devise itself. and there you might get a better help for your question. but I googled around. something I assume you have done and it seems that

[Rails] Re: rspec rails 3 views authenticate

2013-05-26 Thread andreo
First thing, there is a forum here: https://groups.google.com/forum/?fromgroups#!forum/plataformatec-devise for devise itself. and there you might get a better help for your question. but I googled around. something I assume you have done and it seems that login_user was a helper you had to

[Rails] Re: Rspec Test Failing?

2013-01-24 Thread fuzzy
Hey Andre, Thanks for your link .. I have seen it before but I did not have the same issue, but I am thinking that it might well be worth my effort to explore using sessions instead of cookies. Thanks again. On Jan 23, 2:48 am, and...@benjamin.dk wrote: That seems like it :) also about your

[Rails] Re: Rspec Test Failing?

2013-01-23 Thread andreo
That seems like it :) also about your cookie problem, is there anything that might look like this: http://stackoverflow.com/questions/9960732/rspec-vs-cookies-the-test-fails-even-if-the-applications-works-simulating-lo all the best, Andre On Tuesday, 22 January 2013 15:00:21 UTC+1, fuzzy

Re: [Rails] Re: Rspec Test Failing?

2013-01-22 Thread andreo
So basically I think you are near the solution: request tests, allow you to test requests(like put and others): https://www.relishapp.com/rspec/rspec-rails/docs/request-specs/request-spec when you doing integration testing at a feature level you dont make requests(you would have instantiate the

[Rails] Re: Rspec Test Failing?

2013-01-22 Thread fuzzy
Hi Andre, Thanks for your reply. I did see a 'put_via_redirect'. So I would have to rewrite the test and use this command and it would be testing the redirect which is a way to test the put? I will give that a try. Thanks again. On Jan 22, 2:57 am, and...@benjamin.dk wrote: So basically I

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread andreo
Hey fuzzy, I think the first thing that is maybe wrong with your spec is that you are trying to do a request inside of a describe. it should be something like: describe #update do before { put employee_path(employee) } it returns something or does something do specify { response.should

Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Hi, `specify` is actually just the same as `it`. It's just there because sometimes it reads better. See here: https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/example_group.rb#L82 - Mirri On Fri, Jan 18, 2013 at 5:22 PM, and...@benjamin.dk wrote: Hey fuzzy, I think the first

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread fuzzy
Hi Andre, Thanks for your reply ... following is the authentication_pages_spec.rb file which now resides in the spec/ features folder ... all of the tests pass except three. require 'spec_helper' describe Authentication do subject { page } describe signin do

[Rails] Re: Rspec Test Failing?

2013-01-18 Thread fuzzy
Thanks Mirri for you post ... I had a look at the link ... are they saying that 'specify' has now been superceded by 'it'? On Jan 18, 10:17 am, Mirri Kim mirri@gmail.com wrote: Hi, `specify` is actually just the same as `it`. It's just there because sometimes it reads better. See

Re: [Rails] Re: Rspec Test Failing?

2013-01-18 Thread Mirri Kim
Nope, just an alias. On Sat, Jan 19, 2013 at 12:48 AM, fuzzy hlog...@gmail.com wrote: Thanks Mirri for you post ... I had a look at the link ... are they saying that 'specify' has now been superceded by 'it'? On Jan 18, 10:17 am, Mirri Kim mirri@gmail.com wrote: Hi, `specify` is

[Rails] Re: Rspec Test Failing?

2013-01-16 Thread fuzzy
I just read that Capybara does not do integration testing ... this I found right at the bottom of the Capybara documentation page. So since all Capybara tests reside in the spec/features folder, I moved the submitting a PUT request to the Employees#update test into the

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
Where do you define valid attributes? You mean, def valid_attributes FactoryGirl.build(:plan).attributes end in plans_controller_spec.rb ? Even if so, I am not sure if it's a right way. soichi -- Posted via http://www.ruby-forum.com/. -- You received this message because you

[Rails] Re: RSpec: controller POST create

2012-11-12 Thread Soichi Ishida
On your controller, use `create!` to see what is preventing the save. Sorry, I don't quite understand what you mean. my plans_controller.rb has def create @plan = Plan.new(params[:plan]) respond_to do |format| if @plan.save format.html { redirect_to @plan, notice:

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Norbert Melzer
What he wants to say is that you should log or print the error-array of your model and look what exactly doesn't fit into your validations. Am 12.11.2012 11:13 schrieb Soichi Ishida li...@ruby-forum.com: On your controller, use `create!` to see what is preventing the save. Sorry, I don't

Re: [Rails] Re: RSpec: controller POST create

2012-11-12 Thread Mirri Kim
Hi Soichi, You can temporarily do `if @plan.save!` to raise an error instead of just having it return false and not give you any feedback. Doing this is okay because you should not bother testing your validations as far as the controller is concerned (you do that on your model). In any case, try

[Rails] Re: rspec failure upon revisit

2012-11-07 Thread Drew Davis
I found the issue was case sensitive 'Sign up' v. 'Sign Up' -- 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 to rubyonrails-talk@googlegroups.com. To unsubscribe

[Rails] Re: rspec failure upon revisit

2012-11-07 Thread Matt Jones
On Tuesday, 6 November 2012 14:21:21 UTC-5, Ruby-Forum.com User wrote: I just returned from a different project after taking a few weeks off of my tutorial. I'm using Ruby on Rails 3 Tutorial - Learn Rails by Example by Michael Hartl. After rebooting my server I ran an rspec spec/

[Rails] Re: Rspec - want to NOT clear database between tests

2012-07-01 Thread Carilda Thomas
Martin Streicher wrote in post #1066742: before(:all) seems well-suited to this problem. It creates data that persists across transactions. https://www.relishapp.com/rspec/rspec-rails/docs/transactions Thank you but (after much googling) I discovered that one cannot load fixtures in

[Rails] Re: Rspec - want to NOT clear database between tests

2012-06-30 Thread Martin Streicher
before(:all) seems well-suited to this problem. It creates data that persists across transactions. https://www.relishapp.com/rspec/rspec-rails/docs/transactions -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on

[Rails] Re: RSpec test model and mailer

2012-06-20 Thread Danko Danko
Ok, thank you -- 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 to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: Rspec for custom validations

2012-05-10 Thread Frederick Cheung
On May 10, 10:47 am, venkata reddy venkatareddy...@gmail.com wrote: Hi all, i am very new when it comes to writing tests, can anyone give me an idea how to write RSpec test for the following custom validation. def validate_campaign_and_ad     unless self.ad.nil? || self.ad.campaign_id ==

[Rails] Re: [rspec-users] rspec-2.10 is released!

2012-05-05 Thread Matt Wynne
Corrections to documentation links: On 4 May 2012, at 02:37, David Chelimsky wrote: rspec-2.10 is released! Cucumber docs http://rubydoc.info/gems/rspec-core http://rubydoc.info/gems/rspec-expectations http://rubydoc.info/gems/rspec-mocks http://rubydoc.info/gems/rspec-rails

Re: [Rails] Re: rspec: identical tests fails when repeated

2012-04-06 Thread Colin Law
On 6 April 2012 01:10, Fearless Fool li...@ruby-forum.com wrote: MORE UPDATE: I beefed up the tests to look at the return code, the # of Premises generated and the assignment.  And things only got stranger:  context POST create do    context with user logged in do      before(:each) do    

[Rails] Re: rspec: identical tests fails when repeated

2012-04-06 Thread Fearless Fool
REDACTED! Okay, it's 100% my error. Ability#initialize IS getting called. The source of my woes: I was explicitly passing :user_id = 1001 to Premise#initialize, which was overriding the :user_id that CanCan was providing. It was bad luck (or bad judgement) that I chose 1001 as the id -- this

[Rails] Re: rspec: identical tests fails when repeated

2012-04-05 Thread Fearless Fool
UPDATE: I noticed that I had a rails console --sandbox running in another window. When I quit that, the behavior of the test changed. Dramatically. I haven't sorted through the new errors, but it's clear that the --sandbox process was causing the db to respond differently. -- Posted via

[Rails] Re: rspec: identical tests fails when repeated

2012-04-05 Thread Fearless Fool
MORE UPDATE: I beefed up the tests to look at the return code, the # of Premises generated and the assignment. And things only got stranger: context POST create do context with user logged in do before(:each) do @user = mock_model(User, :admin? = false, :guest? = false)

[Rails] Re: rspec-2.9.0.rc1 is released!

2012-03-12 Thread David Chelimsky
There was an error in one of the gemspecs so I just released 2.9.0.rc2. No other changes since rc1. Cheers, David On Sun, Mar 11, 2012 at 9:10 PM, David Chelimsky dchelim...@gmail.com wrote: rspec-2.9.0.rc1 has been released, with numerous enhancements and bug fixes: ### rspec-core-2.9.0.rc1

[Rails] Re: Rspec and restful routes

2012-02-07 Thread edward michaels
Thanks, you don't declare the restful routes in your controller though, right? The error that I'm getting specifies that there is no 'show' action like this: ActionController::RoutingError: No route matches {:controller=users, :action=users/1} So it's looking for a 'users/1'

Re: [Rails] Re: Rspec and restful routes

2012-02-07 Thread Peter Vandenabeele
On Tue, Feb 7, 2012 at 3:07 PM, edward michaels micah...@gmail.com wrote: Thanks, you don't declare the restful routes in your controller though, right? In the case I showed, I _do_ declare the default RESTful routes in the config/routes.rb (they are set there by the rails generator): $ cat

[Rails] Re: Rspec and restful routes

2012-02-07 Thread gerbdla
use that looks incorrect the restful actions are actions like show index create etc etc On Feb 7, 6:07 am, edward michaels micah...@gmail.com wrote: Thanks, you don't declare the restful routes in your controller though, right?  The error that I'm getting specifies that there is no 'show'

[Rails] Re: Rspec :js = true issue (Rails 3)

2011-12-22 Thread Jeff Miller
UPDATE: I got this working by using tips from the following blog: http://www.neotericdesign.com/blog/capybara-webkit-rspec-and-javascript I changed my gemfile to use the following gems: # For Testing w/ Javascript support. # Rspec needs to be in the development group to expose generators

[Rails] Re: Rspec :js = true issue (Rails 3)

2011-12-22 Thread Jeff Miller
Okay, maybe I spoke too soon. Can't help but be hopeful, lol. I have a bunch of fill_in statements for the page I'm testing, such as: fill_in shopper_first_name, with: 'Jeffrey' etc... however, although I'm not getting an error anymore, it DOES NOT fill in the text UNLESS I get rid of :js =

[Rails] Re: Rspec :js = true issue (Rails 3)

2011-12-22 Thread Jeff Miller
*headslam* I just needed to RTFM more closely. I assumed the fields weren't being populated because I was using launchy to save_and_open_page to see if it had done so. Capybara-webkit doesn't instantiate a browser though, it access the renderer (webkit) directly. This is working now :P --

[Rails] Re: RSpec 2 not working on Rails 3.1.1

2011-10-21 Thread Juan David Z.
Hi there, I was having the same issue, it turned out that was some minitest and turn issue. Just REMOVE this lines from your Gemfile gem 'turn' gem 'minitest' Next do a bundle update and that should solve the issue. -- Posted via http://www.ruby-forum.com/. -- You received this message

[Rails] Re: RSpec 2 not working on Rails 3.1.1

2011-10-20 Thread Ron d.
I'm having this issue as well. Any thoughts on what the conflict is? -- 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 to rubyonrails-talk@googlegroups.com. To

[Rails] Re: RSpec 2 not working on Rails 3.1.1

2011-10-18 Thread Logan Abbott
I am having the exact same issue. Help is appreciated. Logan -- 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 to rubyonrails-talk@googlegroups.com. To

[Rails] Re: rspec post with file

2011-09-02 Thread 7stud --
pepe wrote in post #1019809: Hi, I am working on a mobile app that sends a post with a file (a picture) embedded in the body of the request. I What does that mean? ALL post requests contain the data in the body of the request. it is not inside a parameter, it is inside of the body.

[Rails] Re: rspec post with file

2011-09-02 Thread pepe
What does that mean?  Are you saying that the html element for the file upload doesn't have a name attribute?  Well, then give it one. There is no HTML element for the file upload The request is built by a cell phone application, not a browser, it has parameter values (e.g.: the file name) but

[Rails] Re: rspec post with file

2011-09-02 Thread Frederick Cheung
On Sep 2, 2:46 pm, pepe p...@betterrpg.com wrote: Hi, I am working on a mobile app that sends a post with a file (a picture) embedded in the body of the request. It is not inside a parameter, it is inside of the body. A simplified example of a curl statement to simulate what the request

[Rails] Re: rspec post with file

2011-09-02 Thread pepe
Thanks a lot Fred, I'll look into that. On Sep 2, 11:38 am, Frederick Cheung frederick.che...@gmail.com wrote: On Sep 2, 2:46 pm, pepe p...@betterrpg.com wrote: Hi, I am working on a mobile app that sends a post with a file (a picture) embedded in the body of the request. It is not

[Rails] Re: rspec error: `inherited': You cannot have more than one Rails::Application (RuntimeError)

2011-09-02 Thread 7stud --
cross posted here: http://stackoverflow.com/questions/7290186/rspec-runs-the-tests-in-another-app -- 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 to

Re: [Rails] Re: rspec error: `inherited': You cannot have more than one Rails::Application (RuntimeError)

2011-09-02 Thread Jim Ruther Nill
On Sat, Sep 3, 2011 at 7:55 AM, 7stud -- li...@ruby-forum.com wrote: cross posted here: http://stackoverflow.com/questions/7290186/rspec-runs-the-tests-in-another-app Haven't encountered that error before. But googling the error message gives quite a few useful results (i think) :D --

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Chelimsky
On Jun 29, 11:07 am, David Zhang dzhan...@gmail.com wrote: 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 =

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Zhang
Thank you very much! So I guess it was a simple issue. But what would I do for the form_for @user_session? I tried... before(:each) do assign(:user_session, mock_model(UserSession).as_new_record) end But that returns the error: Failure/Error: assign(:user_session,

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Chelimsky
On Jun 29, 12:16 pm, David Zhang dzhan...@gmail.com wrote: Thank you very much!  So I guess it was a simple issue. But what would I do for the form_for @user_session?  I tried...     before(:each) do       assign(:user_session, mock_model(UserSession).as_new_record)     end But that

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Zhang
...That's odd. I just read The RSpec Book, and it explains how double isn't sufficient when you're testing something related to form_for. The book, in its example, says to use mock_model(Message).as_new_record... and anyway in my case neither method is working. If I use mock_model, I get

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Chelimsky
On Jun 29, 1:46 pm, David Zhang dzhan...@gmail.com wrote: ...That's odd.  I just read The RSpec Book, and it explains how double isn't sufficient when you're testing something related to form_for.  The book, in its example, says to use mock_model(Message).as_new_record... and anyway in my case

[Rails] Re: RSpec with Rails 3.1rc4: spec test won't recognize %= % (should be simple)

2011-06-29 Thread David Zhang
Thanks again - I just used the model directly. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/i6n0tRJJ69kJ. To post to this group, send email to

[Rails] Re: RSpec book help; why won't this stub method work?

2011-06-23 Thread Chirag Singhal
count is a class method, so maybe you should try stubbing it on the Message class -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/1JezJOD5dvsJ.

[Rails] Re: RSpec book help; why won't this stub method work?

2011-06-23 Thread David Zhang
That did it! Thanks - I didn't know class methods required that. Message.stub(:count).and_return(9) -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To view this discussion on the web visit

[Rails] Re: RSpec / Capybara ? (from The RSpec Book): Why might should have_selector silently pass when nested?

2011-06-14 Thread paul h
On Jun 13, 7:22 pm, daze dmonopol...@gmail.com wrote: Thank you.  But then what should be the work around for this with Capybara?  I was leaning toward using capybara... Actually, do you recommend webrat over capybara?  I just want one with good documentation and stick with one for the sake

[Rails] Re: RSpec / Capybara ? (from The RSpec Book): Why might should have_selector silently pass when nested?

2011-06-13 Thread David Chelimsky
On Jun 13, 8:36 am, daze dmonopol...@gmail.com wrote: I'm going through The RSpec Book, and (specifically around page 333) I encountered a problem.  Basically, whenever I use should have_selector in a nested form, it silently passes when it SHOULD fail. I've been copying the code exactly as

[Rails] Re: RSpec / Capybara ? (from The RSpec Book): Why might should have_selector silently pass when nested?

2011-06-13 Thread daze
Thank you. But then what should be the work around for this with Capybara? I was leaning toward using capybara... Actually, do you recommend webrat over capybara? I just want one with good documentation and stick with one for the sake of getting used to the syntax. Now... One last thing. I

[Rails] Re: RSpec / Capybara ? (from The RSpec Book): Why might should have_selector silently pass when nested?

2011-06-13 Thread David Chelimsky
On Jun 13, 1:22 pm, daze dmonopol...@gmail.com wrote: Thank you.  But then what should be the work around for this with Capybara?  I was leaning toward using capybara... rendered.should have_selector(form input[@type='submit']) You can also use assert_select which ships with Rails and

[Rails] Re: rspec - Could not find generator rspec_controller

2011-04-27 Thread Robert Walker
Sergio Ruiz wrote in post #995322: for some reason, i cannot get the rspec generators to work. i am getting the following: $ rails generate rspec_controller Could not find generator rspec_controller. the rest of the parts of rspec (that i am familiar with) seem to be doing just fine. i

[Rails] Re: rspec - Could not find generator rspec_controller

2011-04-27 Thread Sergio Ruiz
perfect! thanks! -- 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 to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to

[Rails] Re: rspec-expectations backward compatability issue

2011-03-24 Thread Tom Tom
Hi, I found the problem with the rspec-expectations flag, it was as pointed out, a NameError, in my config/application file I had the wrong name. The rack 1.2.2 problem still persists if anyone has any pointers. Thanks, fuzzy. -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: rspec or shoulda?

2011-02-25 Thread JB
Hi, Mauro. I've been using rSpec with Cucumber, and have just scratched shoulda... My feeling is that it really depends on how comfortable you are with each one when you read your tests. Read them allowed. Functionality and syntax are equivalent. Regards, jb On Feb 25, 7:48 am, Mauro

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread Mauro
On 25 February 2011 09:12, JB jose.bon...@gmail.com wrote: Hi, Mauro. I've been using rSpec with Cucumber, and have just scratched shoulda... My feeling is that it really depends on how comfortable you are with each one when you read your tests. Read them allowed. Functionality and syntax

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread Peter Hickman
I just love shoulda. It is such a step up from plain tests. It allows me to write more readable tests without having to have damn_stupid_test_names_that_try_and_explain_everything. The selling point is the context do ... end and the fact that you can have setup do ... end nested at various

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread Franz Strebel
Shoulda is great. I use it for all my tests along with factory_girl, faker, and flexmock. And then I have autotest running in the background. -- 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

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread Mauro
On 25 February 2011 10:49, Franz Strebel franz.stre...@gmail.com wrote: Shoulda is great.  I use it for all my tests along with factory_girl, faker, and flexmock. And then I have autotest running in the background. With spork and autotest-notification? -- You received this message because

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread radhames brito
I use rspec with shoulda, since shoulda now supports ( and will only support) rspec's syntax, the context framework is going to be taken out and will not be updated so at the end it will all look like rspec matchers. I use group :test do gem 'rspec', '=2.0.0' gem 'rspec-rails', '=2.0.0' gem

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread radhames brito
Here is what a read about shoulda http://robots.thoughtbot.com/post/701863189/shoulda-rails3-and-beyond -- 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 rubyonrails-talk@googlegroups.com. To unsubscribe

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread Mauro
On 25 February 2011 12:08, radhames brito rbri...@gmail.com wrote: I use rspec with shoulda, since shoulda now supports ( and will only support) rspec's syntax, the context framework is going to be taken out and will not be updated so at the end it will all look like rspec matchers. I use

Re: [Rails] Re: rspec or shoulda?

2011-02-25 Thread pe medeiros
Agreed... I'm beginning with Rspec plus Cucumber, but When I was looking for info I found both pretty good, it depends on witch one you are most comfortable with. On Fri, Feb 25, 2011 at 6:12 AM, JB jose.bon...@gmail.com wrote: Hi, Mauro. I've been using rSpec with Cucumber, and have just

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-24 Thread adam
Thank you - however that code it already in place.. On Jan 23, 5:29 pm, Arailsdemo A. li...@ruby-forum.com wrote: Try adding this to your spec_helper.rb Spork.each_run do   require 'factory_girl_rails' end adam wrote in post #976883: Strangely - I am not getting this error when running

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-23 Thread Arailsdemo A.
Try adding this to your spec_helper.rb Spork.each_run do require 'factory_girl_rails' end adam wrote in post #976883: Strangely - I am not getting this error when running seperate features, only when running just cucucmber --drb -- Posted via http://www.ruby-forum.com/. -- You received

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-22 Thread adam
Thanks guys, got autotest running now with the hack, working like a charm - now I remember that sometimes I do actually enjoy coding! :) Now to get it working properly with Cucumber and Factory Girl (uninitialized constant Factory) ... On Jan 21, 7:12 pm, Arailsdemo A. li...@ruby-forum.com

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-22 Thread Peter Vandenabeele
adam wrote in post #976772: Now to get it working properly with Cucumber and Factory Girl (uninitialized constant Factory) ... That could be a confusion between version 1.3 and 2. Compare this: https://github.com/thoughtbot/factory_girl#readme

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-22 Thread adam
Thank you, but I still get the same error - uninitialized constant FactoryGirl (NameError) I have also posted on the FactoryGirl list: https://groups.google.com/group/factory_girl/browse_thread/thread/8de21a97486?hl=en (see bottom of the thread) Regards Adam On Jan 22, 4:05 pm, Peter

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-22 Thread adam
Strangely - I am not getting this error when running seperate features, only when running just cucucmber --drb On Jan 23, 6:39 am, adam adam.elemen...@gmail.com wrote: Thank you, but I still get the same error - uninitialized constant FactoryGirl (NameError) I have also posted on the

[Rails] Re: RSpec / Cucumber painfully slow Rails 3 OSX

2011-01-21 Thread Marnen Laibow-Koser
Arailsdemo A. wrote in post #976437: 1) If your running 'rake spec', then don't, unless you need to do 'rake db:test:prepare' also. But don't you always need to do that? Isn't that the task that clears out the test DB? Or is that not an issue since you're (hopefully) running your specs

  1   2   3   >