Displaying 20 results from an estimated 11000 matches similar to: "should_have_tag: What am I doing wrong?"
2006 Oct 17
3
Should fixtures be transactional?
I started using the new Model.should_have(1).records expectation in
rspec_on_rails, and quickly realized that my fixtures were remaining
loaded, even in contexts that didn''t use them. Bug or feature?
Jay Levitt
2007 Aug 13
2
Backtrace tweaker - broken or me?
Using 1.0.8, I just realized that I''ve been scrolling through pages of
backtraces when rspec is supposed to clean them up for me. This is a
new development machine, so I''m not sure if older versions worked or
not. I''m running Ruby 1.8.6, Rails edge, Mac OS X 10.4.10.
I''ve verified that the QuietBacktraceTweaker is the one that''s running.
2007 Aug 27
7
Foreign key constraints, fixtures, and rake task
I''ve got a spec that loads a fixture in the "before" block. This works
fine running scripts/spec, but when I run rake spec instead, I get:
ActiveRecord::StatementInvalid in ''User in fixture :quentin with an IM
service but no IM name should be invalid''
Mysql::Error: Cannot delete or update a parent row: a foreign key
constraint fails
2006 Nov 06
1
Integration testing: coupling of get and post on forms
This is such a vague request it''s not even worthy of a ticket, but:
When rspec does support integration testing, it''d be really nice to be
able to do things like this plugin does for standard Rails tests:
http://www.jasongarber.com/articles/2006/10/24/easier-testing-of-forms-form_test_helper
In a nutshell, it finally closes the loop between "the empty form sent
by a
2006 Nov 07
1
RSpec/Selenium start_browser_once patch?
The 0.7.0 vendor/selenium/README.txt references a
"start_browser_once.patch" file. This doesn''t seem to be included in
either the rspec or selenium-rc distributions, and Google finds
nothing... where might I find that patch?
Jay Levitt
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
2006 Nov 07
1
Should Selenium support be doing rollbacks?
Now that 0.7.0 is forcing me to write properly compartmented specs, I
thought I''d give the "dead easy Selenium support" a try.
Is it supposed to all the things that rspec normally does for me, or is
it just for using rspec-like grammar to surround Selenium tests?
Specifically, should it roll back the database between specifications?
I just did a quick test, and the result
2006 Nov 07
7
should_redirect_to in advance - feels unnatural
I can understand that it''s easier for rspec to set up a mock in advance
of the controller call. But it makes it difficult to do something like:
context "The HarkController, given Louie the logged-in user" do
setup do
post :login, :username => ''louie'', :password => ''atest''
end
specify "should redirect Louie to the home
2008 Mar 16
3
undefined method `redirect_to'
Hi all. I''m getting the following error in my app:
undefined method `redirect_to'' for ActionController::Base:Class
I''m using Windows 2000, Rails 2.0.2 and resource_controller (from
James Golick).
My controller:
class CommentsController < ApplicationController
include ResourceController::Controller
belongs_to :post, :article, :photo
create do
2007 Sep 16
10
I lost the RSpec fight
I''ve been working on a Rails project with one other developer; he was
using Test::Unit, and I was using RSpec. That works OK for a while, but
obviously it starts causing pain when you have to check in two places to
see if a piece of code is properly tested/spec''d, you can''t use TextMate
shortcuts to switch back and forth between code and test, you have to
duplicate
2007 Jan 16
2
Links in view specs
Hi
I have this simple view (used by the Gap controller):
<h1>Gap#index</h1>
<%= link_to "Get a GAP quote", :action => "get_quote" %>
And this spec:
context "A rendered gap/index" do
setup do
render ''gap/index''
end
specify "should have a link to the get_quote page" do
2008 Jun 14
1
Caseless folder delivery?
I'm using exim4 to deliver into dovecot 1.1, and using plus-addressing to
deliver mailing lists directly to appropriate folders in my "lists" mailbox.
I created a file called /folder-map.lists that looks like
## folder-map.lists
dovecot: Dovecot
lpedge: Linux PowerEdge
... and so on. So mail to lists-lpedge at jay.fm goes to the "Linux PowerEdge"
folder.
The one
2007 Aug 06
2
Specifying custom rails FormBuilders
I want to write a spec for a custom form builder, but I''m not really
sure where it should live or how to include the right rspec_on_rails
contexts. Ideally, I should be able to write a spec like:
describe LabelledBuilder do
it "should let me create a text field" do
object = mock(object)
object.stub!(:attribute).and_return("Test String")
render
2008 Aug 28
2
HostName not quite working as expected?
Setting up a few hosts in a small domain, I thought I'd save keystrokes
by defining ssh_config aliases for their
non-canonicalized names. For example:
Host myhost
HostName myhost.example.com
Host *.example.com
Port 23
...
I would have expected that "ssh myhost" would then start a session on
port 23 (instead of 22). And I've seen blog/list posts that suggest the
same
2008 Jun 14
2
FTS/squat search indexes built when?
I know that a given search index doesn't get built the first time until
you do an actual search on it from an IMAP client. I don't much care
about that; I'm the only user, and I don't create new folders too
often. At worst, I could create a script to go search every folder once.
But what I'm not clear about: Does it then get updated on every delivery
by LDA? Or does the
2007 Aug 02
2
got/expects causes mental layering violation
I was, for the first time, spec''ing a class that redefined ==. And my
spec was incorrect, so == was returning false.
The result was something like:
class C
def ==(other)
false
end
end
.. C.new.should == other...
expected other, got #<C:0x7f03c454> (using ==)
But wait! Why on earth is == returning the class itself instead of
true/false? That shouldn''t be
2006 Nov 10
3
Stubbing Time.now in trunk
I''m a big fan of stubbing Time.now so it returns a known value. I used
to be able to use stubba and say:
@time_now = Time.parse("Jan 1 2001")
Time.stubs(:now).returns(lambda{@time_now})
However, something in trunk broke that. Fine, rspec''s got its own
stubbing lib now, so I tried switching to that:
@time_now = Time.parse("Jan 1 2001")
2007 Feb 15
1
Specs for RJS HTML output NOT containing an element
Hi
I have an RJS template that renders a partial to update a page. I
just added a parameter to get passed into this partial to eliminate a
row in the table it generates, but I can''t find a way to test that
the unwanted output is in fact missing. should(_not)_have_tag
doesn''t work with RJS, and there''s no should_not_have from assert
select.
What
2006 Nov 08
1
controller.session not same as session?
> context "A user logging out" do
> fixtures :users
> controller_name :account
>
> setup do
> login_as :quentin
> users(:quentin).remember_me
> request.cookies["auth_token"] = cookie_for(:quentin)
> end
>
> def logout
> get :logout
> end
>
> specify "should unset :user in session" do
2000 Mar 12
2
Trouble building 1.2.2p1 on Solaris 2.7
I installed OpenSSL 0.9.5 in the default location (/usr/local/ssl) on my
Solaris 2.7 box, and then tried to install OpenSSH 1.2.2p1. Configure (with
no arguments) complains that it can't find working OpenSSL libraries. The
last few lines of config.log show a whole bunch of attempts to compile the
test code, all failing of course.
My /usr/local/ssl DOES have an include/openssl directory