similar to: controller.expect_render has me beat!

Displaying 20 results from an estimated 2000 matches similar to: "controller.expect_render has me beat!"

2008 Jan 23
4
expect_render(...).and_return(''x'')
Hi, I''m trying to spec a controller method which renders some rjs as part of a render :update block. The problem I''m having is that stub_render or expect_render don''t seem to allow and_return to work. The controller method does: if @thing.save render :update do |page| page.insert_html :bottom,
2007 Aug 13
8
How to use expect_render?
Hi: I am a rspec beginner. I have scratched my head for the whole afternoon, trying to figure out a way of writing render expectation in controller spec. However, I failed. It kept telling me that the ''expect_render'' was an undefined method. I have installed rspec 1.0.8 and rspec_on_rails as well. Below is the controller to be tested. Controller def index pre
2007 Sep 25
12
Problems with expect_render
Hi there, I''ve been working with RSpec for about a week now, and the process of moving from a Test::Unit + Mocha setup to an RSpec + Mocha environment has been pretty straightforward. Except, I''m having problems with using template.expect_render. I have Mocha enabled with: > config.mock_with :mocha in spec_helper. And then I have a view spec which looks like this:
2007 Jul 14
3
expect_render twice in views
I found this: controller.expect_render(:partial => ''thing'', :collection => things).once but I am trying to expect_render twice in my view spec: template.expect_render(:partial => ''order_details'').twice This doesn''t work as the template.expect_render call seems to be returning an array. Is it possible to expect the rendering of a partial
2007 Jun 27
3
template.expect_render
Trunksters, I just added a couple of methods to ActionView::Base in Spec::Rails (as of r2136) that lets you do this in view examples: describe ''/things/index.html.erb'' do it "should render _thing with a collection of things" do assigns[:things] = things = [Object.new] template.expect_render(:partial => ''thing'', :collection => things)
2007 Oct 22
13
An error on edge at -r 2767
Morning, Having done an svn up this morning all my specs are broken with the following: SQLite3::SQLException in ServiceConfig with minimum set of valid parameters should return nil for the service path'' SQL logic error or missing database C:/development/sandbox/prototypes/user_admin_client/config/../vendor/plugins/rspec_on_rails/lib/spec/rails/dsl/behaviour/rails_example.rb:17:in
2008 Aug 08
2
template.expect_render fails when partial is rendered from a helper
My spec; describe ''subnav rendering while logged in'' do before do template.stub!(:logged_in?).and_return(true) template.stub! (:current_profile).at_least(:once).and_return(mock_profile) end def do_render render "/homepages/show.html.erb" end it "should render the logged in partial for homepages" do
2007 Aug 14
12
expect_render, why does there need to be a warning
There is a warning on the web site about expect_render and stub_render: "WARNING: expect_render and stub_render, while very useful, act differently from standard Message Expectations (a.k.a. mock expectations), which would never pass calls through to the real object. This can be very confusing when there are failures if you''re not aware of this fact, because some calls will be
2007 Nov 29
4
Rollbacks, Sqlite3 bug. Has this been reintroduced ?
Hey, I just updated from the edge and it looks like this _issue_ has resurfaced. Yesterday things were working (stories and specs). No code base changes, only rspec and rspec_on_rails After updating today I now need to set <config.txn...fixtures> to false in the spec_helper.rb to get the specs running, the stories are fine. Looks like the fixture loading is trying to start a txn. I
2007 Aug 09
3
AutoTest plugin and rspec for rails
(WinXP) Hi, I have the autotest rails plugin running - detecting changes and running the examples. However the rspec color output (of which I am a fan) ... has stopped happening Anybody got a spare moment to point me in the right direction, please ? Cheers! sinclair -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Nov 14
4
Stubbing out required associated models
Hello, As I''m becoming more and more familiar with mocking/stubbing, I''m going back to some of my model specs and revaluating how I wrote them. I have certain models in which validation requires the presence of an associated model, which itself needs to be valid(validates_presence_of and validates_associated). When I wrote the specs, I wrote helpers for the attributes instead
2007 Dec 07
4
TextMate Sidebar
Hey David, I just watched the RubyConf recording of your RSpec session and noticed that you''re using a modified version of TextMate that uses a sidebar instead of a project drawer. Where did you find that mod? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071207/c900e1bc/attachment.html
2007 Sep 28
2
form action url example
Hi, I have the following example: it ''should have a form with an action attribute'' do response.should have_tag( "form[action=?]", ''/users/1/machines/1/trouble_tickets'') end for a form like so: <% form_for( :trouble_ticket, :url => { :action => ''create'', :user_id => @machine.current_owner,
2007 Nov 13
3
Story problem if parenthesis used in Given, When, Then or And
VERSION: rspec rails plugin current edge version XP/Cygwin on XP Hi, I hit this when trying to use parenthesis in my stories ... (that''ll teach me!). If a scenario looks like the following: Story "User has story with parentheses", %{ As a user I want parenthesis So that ... well I just do }, :type => RailsStory do Scenario "the Given has parentheses" do
2007 Aug 02
2
Do the :attributes and :content matchers work
[Rails plugin 1.0.5] Hi, I am looking for some guidance. When working on a partial which looks like this <div class="bug" style="width: 100%;" /> I have some examples which should fail - I think - but do not: it '' should fail'' do response.should have_tag( ''div.bug'', :content => ''There is no
2008 Mar 12
2
RSpec view test for :partial with :locals?
I''m currently working on some RSpec view tests and I''m having problems with expect_render. Most of the expect_render''s work fine, but in one of my views I have: <%= render :partial => "user_cloud", :locals => {:user => @featured_user} %> I see that expect_render supports ":object" or ":collection" for the second
2007 Oct 26
3
Specing with Subdomains as Account Keys
How do you go about implementing and rspecing subdomains as account keys? I''m sure that this must be an issues for others as well. So I have an app using subdomains as account keys. The Application Controller sets up @current_company in a before filter. Everything is done within the context of the @current_company. After reading about Demeter''s Revenge
2007 Oct 25
6
Rollbacks, Sqlite3 bug
Okay - so the sqlite bug reported a day or so ago on the list is real bug. I''m going to file something in the tracker for that... I also learned that before(:all)...after(:all) is not wrapped in a transaction, the way before(:each)...after(:each) is. Is there some reason behind this? Can you not wrap transactions inside transactions? Scott
2008 Mar 05
3
having trouble specing an ajax request
Do I need to spec an AR. If yes, what is the best way to spec this. here is the code - def index @deals = Deal.paginate(:all, :conditions => prepare_search_conditions, :order => ''created_at DESC'', :page => params[:page] ) if request.xhr? render :update do |page| page.replace_html "table", :partial =>
2007 Sep 13
5
Authenticating before tests
Hi all, I''m using Goldberg, an engine that provides roles based access control for my app. I need to login before I can do controller tests, but I can''t find any examples of people doing this. Could someone point me in the right direction? I thought the simplest way would be to either call the login action from my other tests before(:all), but I can''t seem to