Re: [rspec-users] How do we include support helpers in request specs?

2011-10-14 Thread Justin Ko
On Oct 13, 2011, at 10:40 PM, Gordon wrote: > Hi, all :) > > I have some working support helpers defined in spec/support/ > controller_macros.rb. > > I'm running "rake spec" before a 'git commit' and observed that the > spec request for my 'brands' controller, > spec/requests/brands_spec.rb fai

Re: [rspec-users] Scope problems for before hooks using helper methods?

2011-10-14 Thread Gordon
> Let's see the helper method please. ---spec/support/controller_macros.rb: start -- module ControllerMacros include Devise::TestHelpers # sets up an instance of a non-admin user def login_user before(:each) do @request.env["devise.mapping"] = Devise.mappin

Re: [rspec-users] Helper methods can't be called within before hooks. Help, please.

2011-10-14 Thread Gordon Yeong
It's just that I did not find my reply surface after 20 mins and was wondering if it was lost. Sorry about that, everyone :( my apologies. On 14 October 2011 16:01, Justin Ko wrote: > > On Oct 13, 2011, at 8:59 PM, Gordon wrote: > > > > > > > Hi, there, > > > > > > I believe I have some proble

Re: [rspec-users] assert_select - to do negative tests - need help with syntax please :)

2011-10-14 Thread Evgeni Dzhelyov
See this https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/testing/assertions/selector.rb#L186 seems the syntax is "[name=...]" ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-use

Re: [rspec-users] assert_select - to do negative tests - need help with syntax please :)

2011-10-14 Thread David Chelimsky
On Oct 13, 2011, at 8:56 PM, Gordon wrote: >> I don't know if you can. Maybe somebody on the Rails list knows. > > If it can't, it means that people can't use assert_select to expect > NOT to find a given element with extra attributes (such as :name) > being defined. If that's the case, i think a

Re: [rspec-users] Scope problems for before hooks using helper methods?

2011-10-14 Thread David Chelimsky
On Oct 14, 2011, at 12:01 AM, Gordon wrote: >> Let's see the helper method please. > > # sets up an instance of a admin user > def login_admin_user >before(:each) do > @request.env["devise.mapping"] = Devise.mappings[:user] > @admin_user = FactoryGirl.create(:admin) > sign_in

Re: [rspec-users] Scope problems for before hooks using helper methods?

2011-10-14 Thread David Chelimsky
On Oct 13, 2011, at 8:35 PM, Gordon wrote: > Hi, there, > > I believe I have some problem with scoping. > Here is the error message: > - Extract start - > > /usr/local/rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.0.9/lib/ > active_support/dependencies.rb:235:in `load