Re: [rspec-users] Rspec 2, Rails 3 and Webrat

2010-06-10 Thread David Chelimsky
Change the directory name to requests (a la merb) Sent from my iPhone On Jun 10, 2010, at 10:35 PM, Rodrigo Rosenfeld Rosas > wrote: Hi guys, I'm trying to port an application to Rails 3 but can't get my integration tests to run. I can't call the Webrat's method (yields 'undefined metho

[rspec-users] Rspec 2, Rails 3 and Webrat

2010-06-10 Thread Rodrigo Rosenfeld Rosas
Hi guys, I'm trying to port an application to Rails 3 but can't get my integration tests to run. I can't call the Webrat's method (yields 'undefined method `visit`', for instance). I don't use Cucumber. Is there any instructions about how to configure Rspec 2 with Webrat on Rails 3? I al

[rspec-users] Stubbing before_filters with RSpec and stub!

2010-06-10 Thread Joseph DelCioppio
Guys, I've got a private controller method which acts as a before_filter that I'm trying to stub. class TasksController < ApplicationController before_filter :load_user .. private def load_user if current_user.id == params[:user_id].to_i @user = current_user else

Re: [rspec-users] Rails 3 Support/Design

2010-06-10 Thread David Chelimsky
On Thu, Jun 10, 2010 at 3:14 PM, geetarista wrote: > Since Rspec-Rails 2 is specifically geared toward Rails 3, I'm > wondering why it doesn't use railtie, the new generators, etc.  Will > it stay this way or is it planned to support that? It does use the new generators, and we do have a railtie,

Re: [rspec-users] Rspec 2 (beta.11) view spec haml

2010-06-10 Thread David Chelimsky
On Thu, Jun 10, 2010 at 2:53 PM, Peter Fitzgibbons wrote: > Hello All, > > I'm trying to view-spec with haml > require 'spec_helper' > > describe "user_sessions/new.html.erb" do >   it "renders blank form" do >     activate_authlogic >     user_session = UserSession.new >     assign :user_session,

[rspec-users] Rails 3 Support/Design

2010-06-10 Thread geetarista
Since Rspec-Rails 2 is specifically geared toward Rails 3, I'm wondering why it doesn't use railtie, the new generators, etc. Will it stay this way or is it planned to support that? ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.

[rspec-users] Rspec 2 (beta.11) view spec haml

2010-06-10 Thread Peter Fitzgibbons
Hello All, I'm trying to view-spec with haml require 'spec_helper' describe "user_sessions/new.html.erb" do it "renders blank form" do activate_authlogic user_session = UserSession.new assign :user_session, user_session debugger render render.should have_tag('text.emai

Re: [rspec-users] RSpec 2 equivalent for: assigns[:message].should == @message

2010-06-10 Thread David Chelimsky
On Thu, Jun 10, 2010 at 11:38 AM, Kristian Mandrup wrote: > describe MessagesController, "POST create" do > >  before(:each) do >   �...@message = mock_model(Message, :save => nil) >    Message.stub(:new).and_return(@message) >  end > > >  context "when the message fails to save" do >    before(:e

[rspec-users] RSpec 2: uninitialized constant - mocking belongs_to AR relation

2010-06-10 Thread Kristian Mandrup
gems/ruby-1.9.2-head/bundler/gems/rspec- core-2398fcadf5beb256bed9c548c59445d3b4c8a047-master/lib/rspec/core/ backward_compatibility.rb:26:in `const_missing': uninitialized constant Message::User (NameError) from /Users/kristianconsult/.rvm/gems/ruby-1.9.2-head/bundler/gems/ rspec-expectati

[rspec-users] RSpec 2: undefined method `controller_name' for :Class (NoMethodError)

2010-06-10 Thread Kristian Mandrup
describe ApplicationController, "handling AccessDenied exceptions" do class FooController < ApplicationController def index raise AccessDenied end end controller_name 'foo' # OUCH!!! it "redirects to the /401.html (access denied) page" do get :index response.should r

[rspec-users] RSpec 2 equivalent for: assigns[:message].should == @message

2010-06-10 Thread Kristian Mandrup
describe MessagesController, "POST create" do before(:each) do @message = mock_model(Message, :save => nil) Message.stub(:new).and_return(@message) end context "when the message fails to save" do before(:each) do @message.stub(:save).and_return(false) end it "ass

Re: [rspec-users] [OT] programming (OOP) principles resources

2010-06-10 Thread Andrew Premdas
Link doesn't work typo? On 10 June 2010 10:43, Julian Leviston wrote: > I'm not so sure "We all know good principles of OOP" actually. > > I'd recommend www.vpri.com.au and looking into the work of Alan Kay. A lot > of his stuff can be found for free online, because it's decades old. > > Julian

Re: [rspec-users] [OT] programming (OOP) principles resources

2010-06-10 Thread Julian Leviston
I'm not so sure "We all know good principles of OOP" actually. I'd recommend www.vpri.com.au and looking into the work of Alan Kay. A lot of his stuff can be found for free online, because it's decades old. Julian On 10/06/2010, at 7:23 PM, Joaquin Rivera Padron wrote: > hi there, > we all kno

[rspec-users] [OT] programming (OOP) principles resources

2010-06-10 Thread Joaquin Rivera Padron
hi there, we all know good principles of OOP and P in general. But I found today that would be good to know which links (e.g [1] [2])books|reads would you recommend on the topic greetings, joaquin [1] http://c2.com/cgi/wiki?PrinciplesOfObjectOrientedDesign [2] http://www.industriallogic.com/paper