Displaying 20 results from an estimated 2000 matches similar to: "integrate_views is not executing my views"
2008 Jun 12
1
map.resources :foo_items, :as => :foo confusing my controller specs
I have following resource defined in my config/routes.rb (the model
name is contrived)
map.resources :foo_items, :as => :foo
that I originally generated with rspec_scaffold:
ruby script/generate rspec_scaffold foo_item
but when I use the :as attribute in resources to make the URI path be
''/foo'' instead of ''/foo_items'' the default/generated controller
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 that level. I''ve already spent far, far too much
2007 Jul 24
6
Mocking Access Control
I''m trying to jump on the TDD/BDD bandwagon, but am having trouble
understanding how i should mock my user. The user has a habtm
relationship to a roles model (acl_system2 plugin), but I''m not sure
how to tell rspec about a model.
My code:
describe UsersController do
integrate_views
before(:each) do
@user = mock_model(User)
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
Dear list,
In the app we are making we have a rout something like this:
map.resources :projects do |projects|
projects.resources :pages, :controller
=>"Wiki::Pages", :path_prefix => "/projects/:project_id/
wiki", :name_prefix => "project_wiki_"
end
But I can''t get RSpec(I''m very new to it) to accept this. It keeps
throwing errors:
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
2007 Sep 14
2
Testing a nested controller
Hey everyone.
I really stuck on testing a nested controller. I''m trying to make a
request using get and afterwards checking the response by
response.should ...
My routes.rb looks like this:
map.resources :writers do |writers|
writers.resources :notes
end
In my notes_controller_spec.rb
def do_get
writer_id = 1
note_id = 1
get note_path(writer_id, note_id)
end
it "should show
2008 Jun 04
5
controller filters running twice in 1.1.4?
since upgrading to 1.1.4 (I had been running without issue on a git
snapshot), I''m noticing that my filter actions initiated from application.rb
seem to be running twice. I created a test rails project with the rspec
scaffold and am also seeing the same behavior here too.
Adding this code to application.rb:
before_filter :foo
def foo
"foo"
end
and an example
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
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
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?
2007 Jul 26
2
rspec_resource error
First of all hi, I''m new to the list, and rather new to rspec as will
probably show in myquestion.
I have tried installing rspec and rspec_on_rails as plugs both using
"script/install" and
"piston import" commands using the "current release install instructions"
here [1]. However,
there doesn''t seem to be any mention of the rspec_resource
2008 Feb 19
3
render_to_string in a controller test?
Hi all,
I know that in general, view and controller tests should be isolated,
such that controller specs don''t test views etc. However, I think
I''ve run into a situation that might be an exception.
My controller uses render_to_string to produce a chunk of HTML that it
passes to a model to be processed.
The controller then redirects the user to a different page. The
2007 May 28
1
Rails matcher render_template is wrong when using GetText, looking for flexible solution
I have a problem with a mismatch between RSpec Rails and the actual
behavior when using GetText, and would be glad for suggestions how to
best solve this.
When using GetText a failure is reported for the following simplified
specification:
describe SamplesController, "when requesting /samples" do
it "should render index " do
get ''index''
2007 Aug 16
17
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
I am getting:
undefined method `mock_model'' for [RSpec example]:#<Class:0x25550a8>
with my view specs after upgrading to 1.0.8. Is anyone else seeing this?
To isolate the message I did the following setup:
- create new rails project (with edge)
- installed rspec and rspec_on_rails
- ran rake spec
- ran script/generate rspec_scaffold products
- tried to run a builtin view
2009 Mar 15
0
rspec-rails 1.2.0 Released
rspec-rails version 1.2.0 has been released!
* <http://rspec.info/>
* <http://wiki.github.com/dchelimsky/rspec>
* <http://wiki.github.com/dchelimsky/rspec/rails>
* <http://wiki.github.com/dchelimsky/rspec/upgrades>
Behaviour Driven Development for Ruby on Rails.
Changes:
### Version 1.2.0
IMPORTANT INFORMATION: Due to changes in Rails-2.3, there are some changes
in
2007 Nov 10
2
be_success misleading
Just wondering if anyone else thinks that ''response.should be_success'' is
potentially misleading. If you''re writing a spec for an action that is
failing in some way it can still have a status 200. So while the
HTTP request was technically successful, something in the action
was not. Perhaps something like ''response.should have_success_status''?
Steve
2008 Oct 09
1
About received unexpected message :code with (no args)
I use rspec_scaffold to generate a part of examples as below:
it "should expose a newly created awarding_body as @awarding_body" do
AwardingBody.should_receive(:new).with({''these'' =>
''params''}).and_return(mock_awarding_body(:save => true))
post :create, :awarding_body => {:these => ''params''}
2009 Jan 15
4
HABTM and Check Boxes (Yet Another thread on this)....
Hi there,
it''s an afternoon that i''m destroying my head on this, and i''ve decided
to ask to you all .
I''ve got to do some check box lists for a modified substruct version i''m
doing, right now, i''m interested to insert a list of categories of
interests into a customer sheet
i''m using the substruct plugin version, wich stays in the
2009 Oct 27
14
Authlogic Password confirmation is too short Error. NEED HELP.
Hi:
I am using authlogic, and following railscast tutorial. I am running
into this error code with the password confirmation.
authlogic password confirmation is too short
Has anyone experienced this error? I need your help.
Thanks in advance for your help.
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