Displaying 20 results from an estimated 2000 matches similar to: "Links in view specs"
2007 Jun 26
4
Fake SSL in specs when using ssl_requirement plug-in
Hi
I''ve used the ssl_required line from the ssl_requirement plug-in at
the start of a controller for SSL. Its implemented as redirects so I
can spec this...
describe "GET /gap/get_qote" do
controller_name :gap
it "should redirect to the HTTPS version of the action" do
get ''get_quote'', :id => "finance"
2006 Nov 28
8
view specs with partials
When I first learned about the View specs I was very excited. I
still am. However, I haven''t found them useful yet for one reason.
They throw the following exception when ever a view renders another
view, which is very common.
ActionView::TemplateError in ''Event View message''
No rhtml, rxml, rjs or delegate template found for spec/rails/
view_spec/_info
2007 Feb 12
6
Specs for Ajax partials with unicode characters
Hi
Not sure if this is more Rails or RSpec related...
I''ve got an app with an RJS view that updates a div in a page with
the contents of a partial. The partial contains a non-ascii
character namely a pound sign.
I set up a simple test app with this RJS view:
page.replace_html("test_div", :partial => "test_action")
and this _test_action.rhtml:
2007 Apr 11
13
View Specs Fail with "protected method render"
I''ve got rspec and zentest installed as well as the rspec rails plugin, and
my model/controller specs all pass and work well. I can''t seem to get views
to work though - 100% of the specs fail with:
NoMethodError in ''/users/show.rhtml should render attributes in <p>''
protected method `render'' called for
2006 Dec 13
4
RSpec and simply_helpful
Hi All
I''m having some problems running my view specs when using
simply_helpful. I have it semi-working via the following:
module SimplyHelpfulHelper
def self.included(base)
base.send :include, SimplyHelpful::RecordIdentificationHelper
base.send :include, SimplyHelpful::RecordTagHelper
end
end
context "The index template" do
setup do
@shift =
2006 Oct 04
1
String.should_hav_tag
I''ve just upgraded to rspec 0.6.4 and several specs were broken. All
for the same reason. String.should_have_tag doesn''t seem to be
supported any longer.
It used to be possible to write assertions like:
response.body.should_have_tag :tag => "form"
or
"<html><body/></html>".should_have_tag :tag => "body"
But these fail
2007 Nov 15
1
''lazy'' url generation in view specs
Hi,
I would like to use the ''lazy'' style of url generation in my views,
omitting parameters from my calls to url_for (and named route
methods) that are then filled in from the current request parameters.
Example:
url_for(:action => ''index'') will fill in (:controller => ''posts'') if
params[:controller] is ''posts''
2006 Dec 31
2
what''s with the response.should_be_xxxx stacktrace?
If I do
get :index
response.should_be_success
I get about 20k of marshalled dumpage that starts like
#<ActionController::TestResponse:0x390443c @body=\"<html><body>You
are being <a href=\"http://test.host/carts/1\">redirected</a>.</body></html>\",
@assigns=[], @redirected_to={:action=>\"show\", :id=>1},
2007 Feb 23
2
Deferred success for specs?
I''ve started using specs as a to-do list. I write explicitly
violated specs so I know what to come back to. But a lot of the
time, that means if I start to work on another piece of functionality
covered by the same spec, it''s hard to tell what I''m working on now
from the explicit failues.
I run all my specs through TextMate to use the HTML output, so I go
by
2007 Jul 31
11
helper spec not finding rails core helpers
Hi,
My helper specs were going ok until I added a call to a rails
DateHelper method in one of my helpers
http://api.rubyonrails.com/classes/ActionView/Helpers/
DateHelper.html#M000574
The helper runs fine from my view templates, just dies in the spec test.
I boiled my question down to a simple (not too useful) example. I''m
not sure what I''m missing.
#
2007 Apr 07
5
Integration Specs On Rails
Now that RSpec is nearing 1 dot oh, are there any plans to implement
an integration testing equivalent in RSpec On Rails?
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
2006 Nov 07
3
include Helper in context?
Brandon,
can you get your Helpers to work in rspec 0.7 ? I''m including them in
the context but the render fails to see it.
If you have it working, I''ll go back and bang my head against it some
more, otherwise I''ll file a bug!
Many thanks,
Jerry
context "account/login (view)" do
include StandardHelpers
specify ''displays title
2006 Oct 31
5
How to run edge RSpec (on Rails)?
I''m interested in tracking edge development of the RSpec on Rails
plugin and I''m a bit confused.
The installation guide
(http://rspec.rubyforge.org/documentation/rails/install.html) says,
"You''ll have to install the RSpec core gem first." It also says,
"Take note of what rspec version you''re installing ? it''s very
important that you
2007 Oct 23
9
Running rails specs outside of the normal project tree
I want to create a spec/regressions directory with various
regressions (for my rails project). I tried the following:
describe LoginController, "regression for user creation when
steves_sister does not exist", :behavior_type => :controller do
controller_name :login
before :each do
@params = {
"commit"=>"Create Account",
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2006 Nov 19
2
underscores, sugar, and more and more bugs
I sent this earlier under with the subject "artificial sugar causes
cancer" and I think some spam filters ate it. Here it is again:
======================================
All,
If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
you''ll see that Chad (the submitter) found the source of the bug.
Unfortunately, the source
2006 Nov 10
3
Specifying views
I''m trying to spec my views with 0.7.1 on edge rails per the
instructions on the rspec site [1] and David''s blog [2], but I''m not
having much luck. Here''s my spec in specs/views/accounts/
new_view_spec.rb:
require File.dirname(__FILE__) + ''/../../spec_helper''
context "The new account form" do
specify "should have an
2006 Nov 19
6
artificial sugar causes cancer
All,
If you look at http://rubyforge.org/tracker/index.php?func=detail&aid=6760&group_id=797&atid=3149
you''ll see that Chad (the submitter) found the source of the bug.
Unfortunately, the source of *this* bug is the *solution* to a
*previous bug* in which Rails was replacing RSpec''s method missing
with its own.
When we settled on underscores, my one reservation was
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives