Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-23 Thread Ash Moran
On 23 Nov 2011, at 07:19, Andrew Premdas wrote: >>> Use Ruby 1.8.7 its much faster. There is a very good screencast on >>> Destroy All Software that might help also - the one about extracting >>> domain objects (or something like that). >> >> Anytime someone suggests using 1.8, a Chinchilla expl

[rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
I don't know where to put this post, but theme of this more similar to my issue. I have trite signin system, like this: > ApplicationController: include SessionsHelper private helper_method :current_user def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread aslak hellesoy
On Wed, Nov 23, 2011 at 3:10 PM, Alex Whiteland wrote: > I don't know where to put this post, Here: http://groups.google.com/group/cukes > but theme of this more similar to > my issue. > > I have trite signin system, like this: > >> ApplicationController: > include SessionsHelper > > private > >

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
Aslak, but if I haven't Google Account? -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread Patrick J. Collins
> I don't know where to put this post, but theme of this more similar to > my issue. The cucumber mailing list is: http://groups.google.com/group/cukes But I can tell you that your problem is a scope issue. Your is_admin? method that is added to cucumber's world does not have access to your appl

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-23 Thread Andrew Premdas
On 23 November 2011 10:54, Ash Moran wrote: > > On 23 Nov 2011, at 07:19, Andrew Premdas wrote: > Use Ruby 1.8.7 its much faster. There is a very good screencast on Destroy All Software that might help also - the one about extracting domain objects (or something like that). >>> >>>

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread aslak hellesoy
On Wed, Nov 23, 2011 at 4:19 PM, Alex Whiteland wrote: > Aslak, but if I haven't Google Account? > You don't need one. Click "About this group", and you'll see the group's email address. Your first message will be moderated. Aslak > -- > Posted via http://www.ruby-forum.com/. >

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread Alex Whiteland
> that is added to cucumber's world does not have access to your > application > controller's @current_user variable. So, I understand this. But how I can avoid this defect? If I paste def is_admin? into application_controller near current_user method, I wouldn't can World(ApplicationController)

Re: [rspec-users] cucumber is_admin? testing

2011-11-23 Thread aslak hellesoy
On Wed, Nov 23, 2011 at 5:55 PM, Alex Whiteland wrote: >> that is added to cucumber's world does not have access to your >> application >> controller's @current_user variable. > > So, I understand this. But how I can avoid this defect? > > If I paste def is_admin? into application_controller near

[rspec-users] test for "lambda {...}.should change(x, y).by(z)" failing.. ?

2011-11-23 Thread Patrick J. Collins
I wrote a test that looked like this: it "increases the user's reputation" do lambda { @comment.update_attribute(:helpful, true) }.should change(@seller.reload, :reputation_score).by(Event.reputation_change_for(:mark_helpful)) end And I am getting this error: 1

Re: [rspec-users] Rails code reloading in RSpec test environment?

2011-11-23 Thread Jason Nah
What's wrong with using spork? Works well for me. The issue I've found is rails loading everything. So the only 'simple fix' is the spork kind (ie process fork) Cheers, Jason On 23/11/2011, at 7:46 AM, Ash Moran wrote: > Hi > > I've worked on a couple of Rails 3 apps recently and the test feed

[rspec-users] customize description and failure messages when writing rspec matcher dsl

2011-11-23 Thread Anran Yang
Dear all, I recently tried to write a custom matcher using rspec dsl, which I'd like to use as the following: ==hpgc_spec.rb=== require "spec_helper" describe Hpgc do specify do should be_structured_as( { :app => { :has => [ :name,