Re: [rspec-users] Undefined methods: has_selector? and flunk

2010-09-01 Thread Michael Schuerig
On Wednesday 01 September 2010, David Chelimsky wrote: > On Sep 1, 2010, at 7:49 AM, Michael Schuerig wrote: > > I'm in the process of updating an app for Rails 3.0 and rspec-rails > > 2.0.0.beta20. When I'm running my specs (rake spec) I get a large > > number of

[rspec-users] Undefined methods: has_selector? and flunk

2010-09-01 Thread Michael Schuerig
define has_selector? (or have_selector? as webrat does). Presumably, this is all just a dependency problem, but I have no clear idea where to look. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users

Re: [rspec-users] RSpec 2/Rails 3 - content_for in view specs

2010-08-28 Thread Michael Schuerig
spec def content_for(name) view.instance_variable_get(:@_content_for)[name] end and then content_for(:sidebar).should ... Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list r

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-05 Thread Michael Schuerig
On Monday 05 July 2010, David Chelimsky wrote: > On Jul 3, 2010, at 4:40 PM, Michael Schuerig wrote: > > On Saturday 03 July 2010, David Chelimsky wrote: > >> On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: > > [double loading of Rails framework classes] > &g

Re: [rspec-users] Loading problem with engine extending ActionController::Base

2010-07-03 Thread Michael Schuerig
On Saturday 03 July 2010, David Chelimsky wrote: > On Jul 3, 2010, at 3:34 PM, Michael Schuerig wrote: [double loading of Rails framework classes] > > require File.dirname(__FILE__) + "/../config/environment" unless > > defined?(Rails) > > This is from an old vers

[rspec-users] Loading problem with engine extending ActionController::Base

2010-07-03 Thread Michael Schuerig
point? Apparently it is not and I have no idea why. rspec spec/some_spec.rb is slightly different. Here ActionController::Base is loaded just once, but the engine callback is not executed. rspec and associated gems are 2.0.0.beta.15 rails is 3.0.0.beta4 I'm stumped. Michael -- Michael Sc

Re: [rspec-users] RSpec 2 view specs: partial mocks

2010-06-22 Thread Michael Schuerig
On Tuesday 22 June 2010, David Chelimsky wrote: > On Jun 22, 2010, at 10:06 AM, David Chelimsky wrote: > > On Jun 22, 2010, at 9:58 AM, Michael Schuerig wrote: > >>> Stubs and assigns are unrelated, so even though this might be a > >>> bug, I don't thin

Re: [rspec-users] RSpec 2 view specs: partial mocks

2010-06-22 Thread Michael Schuerig
On Tuesday 22 June 2010, David Chelimsky wrote: > On Jun 22, 2010, at 8:27 AM, Michael Schuerig wrote: > > #_view (and #view in turn) creates just one ActionView::Base > > instance the first time it is called. That's as it is intended. > > The effect is, however, th

Re: [rspec-users] RSpec 2 view specs: partial mocks

2010-06-22 Thread Michael Schuerig
On Sunday 20 June 2010, Michael Schuerig wrote: > Are partial mocks supposed to work in rails-rspec 2.0.0.beta.12? > > I'm trying to do things like > > view.stub(:current_user).and_return(@user) > view.stub(:current_page?).and_return(false) > > However, when

Re: [rspec-users] RSpec 2 view specs: partial mocks

2010-06-20 Thread Michael Schuerig
On Monday 21 June 2010, David Chelimsky wrote: > On Jun 20, 2010, at 5:18 PM, Michael Schuerig wrote: > > # in spec/spec_helpers.rb > > > > config.include PartialHelpers, :example_group => { > > > >:description => lambda { |description| > >

Re: [rspec-users] RSpec 2 view specs: partial mocks

2010-06-20 Thread Michael Schuerig
On Sunday 20 June 2010, David Chelimsky wrote: > On Jun 20, 2010, at 3:19 PM, Michael Schuerig wrote: > > Are partial mocks supposed to work in rails-rspec 2.0.0.beta.12? > > > > I'm trying to do things like > > > > view.stub(:current_user).and_retu

[rspec-users] RSpec 2 view specs: partial mocks

2010-06-20 Thread Michael Schuerig
th Rails 3 and RSpec 2 and so I'm stumbling around alot in the sources and inch along in the debugger. One repeating point of bother is that often stacktraces are barely informative when delegation and dynamically generated code are in there. Unfortunately, I can't think of a way to improv

Re: [rspec-users] RSpec 2 view example: render_template

2010-06-20 Thread Michael Schuerig
On Sunday 20 June 2010, David Chelimsky wrote: > On Jun 20, 2010, at 9:35 AM, Michael Schuerig wrote: > > I already found out, that I > > can set expectations with view.should_receive(:render) like I did > > in pre-2.0 with template.should_receive(:render). > > That do

Re: [rspec-users] RSpec 2 view example: render_template

2010-06-20 Thread Michael Schuerig
On Sunday 20 June 2010, David Chelimsky wrote: > On Jun 20, 2010, at 8:03 AM, David Chelimsky wrote: > > On Jun 20, 2010, at 7:30 AM, Michael Schuerig wrote: > >> On http://github.com/rspec/rspec-rails under "View specs" there's > >> an example >

Re: [rspec-users] RSpec 2 view example: render_template

2010-06-20 Thread Michael Schuerig
On Sunday 20 June 2010, David Chelimsky wrote: > On Jun 20, 2010, at 7:30 AM, Michael Schuerig wrote: > > On http://github.com/rspec/rspec-rails under "View specs" there's > > an example > > > > describe "events/index.html.erb" do >

[rspec-users] RSpec 2 view example: render_template

2010-06-20 Thread Michael Schuerig
undefined method `render_template' for # Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] RSpec 2: view example groups don't load helpers?

2010-06-19 Thread Michael Schuerig
On Sunday 20 June 2010, David Chelimsky wrote: > On Jun 19, 2010, at 4:19 PM, Michael Schuerig wrote: > > If not, what do I have to do to make the specs aware of helpers? > > helper(MyHelper, :my_helper, 'other_helper') I see. Thanks, that works. Michael -- Mic

[rspec-users] RSpec 2: view example groups don't load helpers?

2010-06-19 Thread Michael Schuerig
12 with Rails 3.0.0.beta4. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

[rspec-users] Cucumber + capybara: checking list items

2010-04-23 Thread Michael Schuerig
ding titles and abstracts are within the same LI. I understand why it doesn't work, for with_scope just builds up a scope chain. Unfortunately, I don't see how to get the check I want. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/

Re: [rspec-users] Controller spec: testing that scope is set

2009-05-21 Thread Michael Schuerig
On Sunday 19 April 2009, Michael Schuerig wrote: > In a Rails controller I set the scope on a model class in an around > filter. I have defined expectations on the model classes, and > ideally, I would add a further expectation for the scope. Is this > already possible in some way? Ho

Re: [rspec-users] rspec-rails: how to run checks?

2009-05-21 Thread Michael Schuerig
On Thursday 21 May 2009, David Chelimsky wrote: > On Thu, May 21, 2009 at 4:26 AM, Michael Schuerig wrote: > > I'm trying to run the specs of the rspec-rails master branch, but > > both plain rake as well as rake spec fail. > > Right now the only way to run them is i

[rspec-users] rspec-rails: how to run checks?

2009-05-21 Thread Michael Schuerig
hings sees to it that Rails is properly required. Any hints on how to get the specs to work? Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Test JSON with Cucumber

2009-05-11 Thread Michael Schuerig
nd "response.code" Then /^I should find "([^\"]*)"$/ do |the_string| json = ActiveSupport::JSON.decode(@response.body) obj = traverse(json, the_string) assert_not_nil obj end def traverse(json, path) path.split('.').inject(json) do |value, selector| value = value[selector] end rescue nil end Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-21 Thread Michael Schuerig
te is mapped onto the real # firstname and lastname attributes. allow :name condition :name => "LOWER(firstname || ' ' || lastname) :op LOWER(?)" order :name => "lastname :dir, firstname :dir" end Michael. -- Michael Schuerig mail

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-20 Thread Michael Schuerig
ope(*args, &block) && (!...@scope_expectation || @scope_expectation.scope_matches?) end end end end Spec::Mocks::MessageExpectation.class_eval do include Spec::Mocks::MessageExpectationScopeExtension end -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ _

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-20 Thread Michael Schuerig
On Monday 20 April 2009, Zach Dennis wrote: > On Sun, Apr 19, 2009 at 6:41 PM, Michael Schuerig wrote: [big snip] > I think I am starting to understand what you're after. You want to > ensure the scope defined in your query_scope configuration block in > the controller is used

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
nt render end end end ... # app/views/people/index.json.rb { :identifier => Person.primary_key, :totalCount => @count, :items => @people.map { |p| render :partial => 'people/item', :locals => { :person => p } } } # app/views/people/_i

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
t's an entirely different spec at a lower level ob abstraction. Michael -- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
On Monday 20 April 2009, David Chelimsky wrote: > On Sun, Apr 19, 2009 at 5:41 PM, Michael Schuerig wrote: > > On Sunday 19 April 2009, Zach Dennis wrote: > >> On Sun, Apr 19, 2009 at 2:09 PM, Michael Schuerig > > > > wrote: > >> > On Sunday 19 April 20

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
On Sunday 19 April 2009, Zach Dennis wrote: > On Sun, Apr 19, 2009 at 2:09 PM, Michael Schuerig wrote: > > On Sunday 19 April 2009, Zach Dennis wrote: > >> On Sun, Apr 19, 2009 at 12:27 PM, Michael Schuerig > > > > wrote: > >> > In a Rails control

Re: [rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
On Sunday 19 April 2009, Zach Dennis wrote: > On Sun, Apr 19, 2009 at 12:27 PM, Michael Schuerig wrote: > > In a Rails controller I set the scope on a model class in an around > > filter. I have defined expectations on the model classes, and > > ideally, I would add a furthe

[rspec-users] Controller spec: testing that scope is set

2009-04-19 Thread Michael Schuerig
-- Michael Schuerig mailto:mich...@schuerig.de http://www.schuerig.de/michael/ ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] JSON matcher

2009-04-07 Thread Michael Schuerig
On Tuesday 07 April 2009, Phlip wrote: > Michael Schuerig wrote: > > def failure_message > > "expected\...@raw_target}\n" + > > "to be JSON code equivalent to\...@raw_expected}\n" + > > "Difference:\...@expected.d

[rspec-users] JSON matcher

2009-04-06 Thread Michael Schuerig
+ "to be JSON code different from\...@raw_expected}" end private def decode(s, which) ActiveSupport::JSON.decode(s) rescue ActiveSupport::JSON::ParseError raise ArgumentError, "Invalid #{which} JSON string: #{s.inspect}" end end

[rspec-users] Testing rails plugins standalone

2008-05-27 Thread Michael Schuerig
d and ActiveSupport. It would be very helpful to have an existing plugin that's tested like this as a guideline. Any suggestions? Thanks, Michael -- Michael Schuerig mailto:[EMAIL PROTECTED] http://www.schuerig.de/michael/ ___ rspec-users mailing list r

[rspec-users] Any news on the rSpec books?

2008-05-03 Thread Michael Schuerig
I admit it, when it comes to rSpec, I'm lazy. I've made a few feeble attempts to use it, but for once I'm waiting for a book-length treatment. At least two books were announced, I think. Can anyone in the know please report on their progress? Thanks Michael -- Michael Schueri