Displaying 20 results from an estimated 26 matches for "integrate_views".
2008 Mar 12
2
Warning: integrate_views and nested description groups
describe MyController do
integrate_views
describe "A common base senario" do
it "no longer integrates views" do
be_careful
end
end
end
integrate_views affects an attribute in the class formed by the describe
factory method. The second describe generates its own class, so
integrate_views is OFF at tha...
2008 Jan 23
2
integrate_views is not executing my views
I wanted to use "integrate_views" as Ryan explains in his RailsCast #71
(http://railscasts.com/episodes/71)
...but I can''t get it to work: the view code in not executed
I looked everywhere but I can''t understand what I am doing wrong.
Here is what I did:
I created a new application from scratch (Rails 2.0....
2011 Jan 17
1
Using integrate_views for all controller specs
Is there a way to always use integrate_views for all controller specs?
I hate having to remember to insert that line into each one.
Thanks,
Joe
2008 Nov 07
0
deprecate integrate_views, WDYT?
I posted a ticket to lighthouse:
http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/595-deprecate-integrate_views
Please put your comments and thoughts there, as that is the best place
for that discussion. I wanted to make it more "visible" so it could
get wide community participation in case there are folks who
absolutely feel integrate_views is necessary (considering that we now
have Cucumber)....
2007 May 23
2
rspec mocha and controller specs without integrated_views
The ability to choose a mocking framework is great as I prefer mocha, but I
am have problems.
On my controller specs, I am forced to ''integrate_views'' as the following
code below shows you, the mocking of views is rspec specific. See stub!
versus mocha''s stub
unless block_given?
unless integrate_views?
@template.stub!(:file_exists?).and_return(true)
@template.should_receive(...
2008 Feb 19
3
render_to_string in a controller test?
...ontroller spec. Because a
controller spec normally doesn''t render views, render_to_string just
returns the path of the view, rather than the rendered output. This
prevents me from testing the output of render_to_string in the
controller spec.
I can work around the issue by using integrate_views, and I guess
that''s fine, but shouldn''t render_to_string really work in controllers?
Thanks for your input,
e.
--
ericw at xmtp.net
"If the answer isn''t violence, neither is your silence!"
-- Pop Will Eat Itself, "Ich Bin Ein A...
2008 Oct 24
4
Correct way to spec partials
Hi everybody,
1) Does anybody have full working example of how to test partial templates?
2) What the correct place to test partials: controller or view spec? If
controller correct place,
should I use integrate_views?
3) Is it true that expect_render is deprecated and I have to
use should_receive(:render)
4) How to test that partial''s locals hash is correct?
Thx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/...
2007 May 28
1
Rails matcher render_template is wrong when using GetText, looking for flexible solution
...hod :
return render_file_without_locale(localized_path, use_full_path,
local_assigns) if file_exists? localized_path
This line always evaluates to true in RSpec context, but to false in
the application.
After a lot of digging I found out that RspecOnRails overrides
file_exists? with a stub when integrate_views is not set
(lib/spec/rails/dsl/behaviour/controller.rb:57):
@template.stub!(:file_exists?).and_return(true)
Now I''m not sure what would be the best solution.
Since I know about this, I could simply add the same extension as
GetText does to the expected rendered view path:
response.sh...
2008 May 26
7
Mocking Models in Controller Specs...
...acancy.stub!(:body)
@vacancy.stub!(:contract)
@vacancy.stub!(:location)
@vacancy.stub!(:salary)
@vacancy.stub!(:benefits)
@vacancy.stub!(:start_date)
@vacancy.stub!(:duration)
I have to stub each of these methods so that the form renders correctly
(as I am using integrate_views). This just feels *way* too much code and
effort to do this. I have a spec for one controller (which just does
plain old CRUD) that is over 300 LOC -- this seems a bit nuts to me when
the controller is only 50 LOC.
Does anybody have any suggestions on how to avoid this or perhaps I am
doing someth...
2007 Jan 05
4
How To Spec Controllers with Finders
Given this code (which renders rjs), I''m faced with the fixture-
driven way of spec-ing or mocking. How the heck to you mock this so
the code at line (2) and (4) work right? I''m still struggling with
mocks but it seems like this can be done. Forgive the naivety of this
question.
1. def change_quantity
2. @line_item = LineItem.find_by_id(params[:id])
3. unless
2012 Mar 22
1
Rspec not loading fixtures
...ests in spec/controllers/downloads_controller_spec.rb
is below. I know it is running and I know that before the ''describe'',
Partner.count == 0, so no fixture.
require File.expand_path(File.dirname(__FILE__) + ''/../spec_helper'')
describe DownloadsController do
integrate_views
describe "when PDF is ready" do
before(:each) do
@registrant = Factory.create(:step_5_registrant)
stub(@registrant).merge_pdf { `touch #{@registrant.pdf_file_path}`
}
@registrant.generate_pdf
@registrant.save!
end
it "provides a link to downloa...
2008 Oct 20
5
RSpec-Rails bug with to_xml?
Hello, everyone. I''ve been lurking here for a while, but this is my first post.
I think I''ve run into a RSpec bug in a Rails project I''m working on. I
was working on a few REST controllers, and started getting failures on
a specific spec that verified whether a certain action returned XML
output. I spent quite a lot of time checking my code to see if it was
something I
2007 Nov 02
2
Test that controller includes helpers?
Is there an easy way to spec that a controller should include helpers
other than its own? I was thinking I could just spec responds_to for
methods I''m interested in in the view, but that seems like crossing a
separation boundary, that the controller maybe doesn''t need to know about?
Thanks,
Steve
2007 Jan 18
1
spec''ing models with observers that send mail
I''m spec''ing a model with an observer that sends mail. Mailers behave
similarly to controllers, so to make the whole thing work, I believe
something like integrate_views has to be available. Has anyone dealt
with observers and ActionMailer?
Thanks
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 Dec 23
1
Rails: possible routing discrepancy
...like this:
<br /><%= link_to_unless_current ''Writing'', writing_path %>
and I have a spec which calls this page, and checks to see that
''Writing'' is not a link:
describe "''/writing/''" do
controller_name :abstracts
integrate_views
it "should not link ''Writing''" do
get ''index'', :index => { :select => ''new'' }
response.body.should_not have_tag( ''a'', ''Writing'' )
end
end
... and it fails.
Normally, I'...
2007 Aug 28
3
How do you keep mocks updated without pain?
...specs like this that risk is real. So you
should be doing this in conjunction with integration testing."
[2] http://railsforum.com/viewtopic.php?id=6528
"I took the past few hours and removed nearly all mocks from my specs.
I also merged the controller and view specs into one using
"integrate_views" in the controller spec. I am also loading all
fixtures for each controller spec so there''s some test data to fill
the views.
The end result? My specs are shorter, simpler, more consistent, less
rigid, and they test the entire stack together (model, view,
controller) so no bugs can s...
2008 Mar 10
2
response.body == filename?
I''m using RSpec.
describe UserController do
it "should require ..." do
post :login, {:name => ''root''}
puts response.body.to_yaml
end
end
....--- user/login
?????
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2008 Mar 12
2
Whence "post" in a description?
I''m having the exact problem described in this earlier post:
http://www.nabble.com/Odd-response.body-behavior-to12837556.html#a12837556
That is, after a post, response.body is just the controller/view string
("user/login" in my case).
Failing to find any answer on the web, I''m trying to trace execution, but
hitting a bit of a snag. I''m tracing the ancestry
2009 Mar 15
0
rspec-rails 1.2.0 Released
...7.
* keep spec_server working against edge rails (Jonathan Tron). Closes #685.
* create lib/tasks if not present when running script/generate
rspec. Closes #687.
* fixed regression (and added spec so it won''t regress again) where
render => :inline didn''t render unless integrate_views was set
* fixed nil.with_output_buffer bug in helper specs. Closes #719.