[rspec-users] Default format for all requests in a spec

2010-08-26 Thread Maurício Linhares
Hi guys, Is there a way to define a default parameter for all requests made in a spec? I have a spec where I want all requests to be made with the js format but I find it rather annoying to type a :format = 'js' on every get/post/put/delete. Is there any other way to do this? - Maurício

[rspec-users] Problem with spec_helper

2010-08-26 Thread Daniel Lidström
Hello, I am a complete newbie to both ruby and rspec. I am following the steps in the railstutorial.org book to learn ruby on rails. The current step involves setting up rspec for the tests, and this is where I am stuck. Here's what I am doing: $ cat spec/controllers/pages_controller_spec.rb

[rspec-users] Controller spec with devise.

2010-08-26 Thread Titinux
Hello, I'm new in using RSpec and I can't figured out to spec this controller action. class OrdersController ApplicationController before_filter :authenticate_user! def index respond_with(@orders = current_user.orders) end end When I want to spec this @assets = Asset.all I use

Re: [rspec-users] Default format for all requests in a spec

2010-08-26 Thread David Chelimsky
On Aug 26, 2010, at 8:12 AM, Maurício Linhares wrote: Hi guys, Is there a way to define a default parameter for all requests made in a spec? I have a spec where I want all requests to be made with the js format but I find it rather annoying to type a :format = 'js' on every

Re: [rspec-users] should raise_error(ArgumentError) resulting in NoMethodError

2010-08-26 Thread Brian Ploetz
*smacks head* Duh. Thanks David and Rob! On Aug 26, 12:35 am, Rob Biedenharn r...@agileconsultingllc.com wrote: On Aug 26, 2010, at 12:14 AM, David Chelimsky wrote: On Aug 25, 2010, at 10:13 PM, Brian Ploetz wrote: Environment -- ruby 1.9.2p0 (2010-08-18 revision

Re: [rspec-users] Problem with spec_helper

2010-08-26 Thread David Chelimsky
On Aug 22, 2010, at 2:10 PM, Daniel Lidström wrote: Hello, I am a complete newbie to both ruby and rspec. I am following the steps in the railstutorial.org book to learn ruby on rails. The current step involves setting up rspec for the tests, and this is where I am stuck. Here's what I am

Re: [rspec-users] Rails3 subdomain constraints with Cucumber and RSpec2

2010-08-26 Thread Cameron Caine
I updated to rc2 and RSpec beta.20 but still get an error: Failure/Error: { :get = http://foo.example.com/account/new; }.should_not be_routable expected {:get=http://foo.example.com/account/new} not to be routable, but it routes to {:controller=accounts, :action=new} Is this a bug? Any

Re: [rspec-users] Rails3 subdomain constraints with Cucumber and RSpec2

2010-08-26 Thread David Chelimsky
On Aug 26, 2010, at 8:22 AM, Cameron Caine wrote: I updated to rc2 and RSpec beta.20 but still get an error: Failure/Error: { :get = http://foo.example.com/account/new; }.should_not be_routable expected {:get=http://foo.example.com/account/new} not to be routable, but it routes to

Re: [rspec-users] Controller spec with devise.

2010-08-26 Thread David Chelimsky
On Aug 24, 2010, at 6:51 PM, Titinux wrote: Hello, I'm new in using RSpec and I can't figured out to spec this controller action. class OrdersController ApplicationController before_filter :authenticate_user! def index respond_with(@orders = current_user.orders) end end

Re: [rspec-users] Problem with spec_helper

2010-08-26 Thread Brennon Bortz
Would not having run rails generate rspec:install cause this problem? On 26 Aug 2010, at 14:21, David Chelimsky wrote: On Aug 22, 2010, at 2:10 PM, Daniel Lidström wrote: snip / So it seems spec_helper is not being found, am I right? A search of my system (Ubuntu 10.04) shows this file in

Re: [rspec-users] Controller spec with devise.

2010-08-26 Thread Matt Wynne
David Chelimsky dchelim...@gmail.com wrote: On Aug 24, 2010, at 6:51 PM, Titinux wrote: Hello, I'm new in using RSpec and I can't figured out to spec this controller action. class OrdersController ApplicationController before_filter :authenticate_user! def index

Re: [rspec-users] Problem with spec_helper

2010-08-26 Thread Daniel Lidström
On 26 Aug, 15:25, Brennon Bortz bren...@brennonbortz.com wrote: Would not having run rails generate rspec:install cause this problem? On 26 Aug 2010, at 14:21, David Chelimsky wrote: On Aug 22, 2010, at 2:10 PM, Daniel Lidström wrote: snip / So it seems spec_helper is not being found,

[rspec-users] rspec can not be found

2010-08-26 Thread dwayne
Hi guys: I'm trying to get my RVM/Rails 2 and 3 mixed environment set up, and I'm still running into problems. Not sure if that's related to rspec not being found, but here's what's happening: $ rake spec --trace (in /Users/dwayne/Sites/casehandler_rails) ** Invoke spec (first_time) ** Invoke

Re: [rspec-users] rspec can not be found

2010-08-26 Thread David Chelimsky
On Aug 26, 2010, at 8:35 AM, dwayne wrote: Hi guys: I'm trying to get my RVM/Rails 2 and 3 mixed environment set up, and I'm still running into problems. Not sure if that's related to rspec not being found, but here's what's happening: $ rake spec --trace (in

[rspec-users] there should be one test or two?

2010-08-26 Thread Zhenning Guan
in real world, when user deposit money into their bank, bank have money and can check deposit record. so what would it be in rspec? it 'should be deposit $10' user.bank.deposit(10) user.bank.deposit.saving.should == 10 end about test , should be deposit $10 is clear? maybe 'should deposit