Re: [rspec-users] How to spec transaction in Controller ?

2009-09-25 Thread Andrea Jahn
this is an example, that writing specs helps to develop better code :) Andrea *Von:* "David Chelimsky" *Gesendet:* 25.09.09 11:58:59 *An:* rspec-users *Betreff:* Re: [rspec-users] How to spec transaction in Controller ? On Fri, Sep 25, 2009 at 3:06 AM, Andrea Jahn wrote: > Hi, >

[rspec-users] How to spec transaction in Controller ?

2009-09-25 Thread Andrea Jahn
Hi, in my Controller I have some tansactions. I'm trying to write specs, which test the two program pathes (an exception is thrown or no exception is thrown). But the test seems always to go into the path, where the exception is catched. Here's an example for the delete action (destroy met

Re: [rspec-users] spec for view with Searchlogic

2009-06-19 Thread Andrea Jahn
ted.new_search(params[:search]) Planning.stub!(:with_associations).and_return(@search) @search.stub!(:not_deleted).and_return(@search) @search.stub!(:new_search).and_return(@search) Andrea *Von:* "Andrea Jahn" *Gesendet:* 25.03.09 15:50:06 *An:* rspec-users@rubyforge.org *Betreff:* [

Re: [rspec-users] spec for view with Searchlogic

2009-06-19 Thread Andrea Jahn
ted.new_search(params[:search]) Planning.stub!(:with_associations).and_return(@search) @search.stub!(:not_deleted).and_return(@search) @search.stub!(:new_search).and_return(@search) Andrea *Von:* "Andrea Jahn" *Gesendet:* 25.03.09 15:50:06 *An:* rspec-users@rubyforge.org *Betreff:* [

Re: [rspec-users] possible to stub params hash ?

2009-04-09 Thread Andrea Jahn
The stub for params was the reason, that put :update has called the index action. Now I pass the params directly in and it works fine: put :update, :pl_planning => {"title" => "Project 1"} Scott, thanks a lot for the tip !!! Andrea *Von:* "Andrea Jahn&

Re: [rspec-users] possible to stub params hash ?

2009-04-09 Thread Andrea Jahn
uot;Scott Taylor" *Gesendet:* 08.04.09 17:46:31 *An:* rspec-users *Betreff:* Re: [rspec-users] possible to stub params hash ? On Apr 8, 2009, at 11:09 AM, Andrea Jahn wrote: Hi, I added one line in my controller to extend the params hash. But now I get errors in my contr

[rspec-users] possible to stub params hash ?

2009-04-08 Thread Andrea Jahn
Hi, I added one line in my controller to extend the params hash. But now I get errors in my controller spec. Controller def update @pl_planning = PlPlanning.find(params[:id]) # the item model version (select box) depends on other select boxes and can be empty # then it is not in the

Re: [rspec-users] what's the different between ( [...@weather]) and (@weather)?

2009-03-26 Thread Andrea Jahn
Hi, Weather.find(1) returns an object: @weather Weather.find(:all) returns an array of objects : [...@weather] look at the api of ActiveRecordBase. http://api.rubyonrails.org/classes/ActiveRecord/Base.html [http://api.rubyonrails.org/classes/ActiveRecord/Base.html] You have not specified

[rspec-users] spec for view with Searchlogic

2009-03-25 Thread Andrea Jahn
Hi, I'm using the Searchlogic plugin. Since I have added the search form in the index template, the view spec doesn't work anymore. Controller - def index @search = PlPlanning.new_search(params[:search]) @search.order_by = :id @pl_plannings, @count = @search.all, @search.count

[rspec-users] errors in controller specs when running by rake

2009-03-05 Thread Andrea Jahn
Hi, I'm working on Windows Vista and I've installed the plugins rspec and rspec-rails V1.1.12. If I run the controller specs directly by ruby, they are all ok: --- C:\InstantRails-2.0-win\rails_apps\myapplication>ruby spec/controllers/planning/pl_plann ings/