Displaying 20 results from an estimated 20000 matches similar to: "Spec::Rails, "model.should have(1).error_on(:attribute)" passes when?"
2009 Mar 23
3
Spec::Rails, "model.should have(1).error_on(:attribute)" passes when?
Spec::Rails people,
I''m curious about:
- model.should have(1).error_on(:attribute)
displayed in the URL below:
http://rspec.rubyforge.org/rspec-rails/1.2.2/classes/Spec/Rails/Extensions/ActiveRecord/InstanceMethods.html
The Rspec peepcode screencast suggests that
model.should have(1).error_on(:attribute)
should pass if
model.send(:attribute)
returns nil
For me, I get an exception
2007 Jun 05
0
Fwd: testing - test/spec and rspec
are you guys aware of this??
:)
Begin forwarded message:
> From: topfunky <topfunkycorporation at gmail.com>
> Date: June 4, 2007 8:35:24 PM EDT
> To: PeepCode <peepcode at googlegroups.com>
> Subject: Re: testing - test/spec and rspec
> Reply-To: peepcode at googlegroups.com
>
>
> On 5/28/07, Neil <neilrahilly at gmail.com> wrote:
>> Just
2009 Jun 13
2
removing Mocha; 'spec spec' fails but the specific model file passes
I happened to mix ryan bates'' authentication scaffold with
rspec_scaffold on a demo project.
and ran into the problem of mixing mock frameworks...ryan uses mocha.
So, as a learning experience, I choose to redo ryan''s tests without
mocha but ran into a strange problem with tests of the User model.
With debugging you can see....
If you run just the user_spec.rb file, everything
2007 Mar 01
2
error_on is deprecated?
The docs say
DEPRECATED. See Spec::Rails::Expectations
model.should_have(:no).errors_on(:attribute)
model.should_have(1).error_on(:attribute)
model.should_have(3).errors_on(:attribute)
However the rdoc for Spec::Rails::Expectations shows the same code.
The only difference is that it''s "model.should
have(1).error_on(:attribute) instead"
So is error_on itself deprecated, or is
2007 Aug 08
3
rspec with autotest on a windows machine
Hello all,
I''m new to rSpec but after reading a couple of tutorials I''ve become
enamored. Anyway, I am at minute 42 of the rSpec basics screencast (
peepcode.com) and I''m having the following error running autotest w/rSpec:
D:\ruby\projects\forecaster>autotest
loading autotest/rails_rspec
c:\ruby\bin\ruby -rrubygems -e "require ''redgreen''"
2007 Aug 10
1
How to spec a model method
Still new to Specs...
How do I create a spec to test a model method? Specifically, here is my
spec:
#testing model
describe User do
it "should have many user roles" do
User.reflect_on_association(:user_roles).should_not be_nil
end
it "should have many roles though user roles" do
User.reflect_on_association(:roles).should_not be_nil
end
it "should know
2007 Sep 16
4
"Not Implemented" doesn''t show
I''m going through Peepcode''s Rspec Basics for an overview.
He''s just doing a simple spec:
class PeepCode
end
describe PeepCode do
it "should be awsome" do
end
end
So running spec spec/simple_spec.rb should produce according to his screen
cast:
1 example, 0 failures, 1 not implemented
but I only recieve:
1 example, 0 failures
Also spec
2007 Mar 06
4
[PIMP] Topfunky''s httperf PeepCode screencast (Zed A. Shaw)
Hi,
Thanks Zed - this is very interesting. One item in particular caught my
eye: Does anyone on this list have any comments or validation that
Rails 1.2.1 is 2-4 times as slow as Rails 1.1.6? Topfunky provided a
link that purports what looks like really horrible performance and
memory characteristics for Rails 1.2.1, even v. 1.1.6:
2007 Mar 06
0
[PIMP] Topfunky''s httperf PeepCode screencast
Hey Everyone,
Topfunky (Geoffry) has created a great PeepCode screencast on using
httperf to performance measure your web applications:
http://nubyonrails.topfunky.com/articles/2007/03/05/peepcode-page-caching-and-httperf
http://peepcode.com/products/benchmarking-with-httperf
Topfunky put a ton of work into this and really got it right. The
attention to detail is very good and he researched
2007 Sep 18
2
FW: Specifying spec and output format inline?
Anyone have any advice on this one?
Thanks,
Adam
________________________________
From: rspec-users-bounces at rubyforge.org
[mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Adam Reed
Sent: Monday, September 17, 2007 2:14 PM
To: rspec-users at rubyforge.org
Subject: [rspec-users] Specifying spec and output format inline?
Howdy from Austin, TX.
I''m new to rspec, and am
2008 May 10
4
Newbie: lambda do...end.should change(Model, :count).by(1). Doesn''t work
Hi to everyone,
I''m an RSpec, and BDD in general, newbie so in order to learn I have
chosen to use my personal website as a tesbed.
I''m having difficulties juggling with mocks, and in particula with the
following code.
Here''s the controller action:
def create
@album = Album.new(params[:album])
if @album.save
flash[:notice] = "album saved"
2007 Sep 20
2
FW: FW: Specifying spec and output format inline?
One more try?
I just want the script to save the rspec output to an html file when the
script is run. In this case, the script will be run from SciTE using
F5, rather than by command line.
Is there a way to specify this within the ruby script?
________________________________
From: rspec-users-bounces at rubyforge.org
[mailto:rspec-users-bounces at rubyforge.org] On Behalf Of Adam Reed
2007 Jul 26
3
Spec for validation plugin
Hi,
I''m writing a specification for a model called Location which has a
post_code attribute which should be a valid UK postcode. I''m using the
http://svn.designbyfront.com/rails/plugins/validates_as_uk_postcode/
validates_as_uk_postcode plugin to handle the validation but I''m not sure
how I should properly specify my model.
Heres the model code:
class Location <
2007 Sep 17
0
Specifying spec and output format inline?
Howdy from Austin, TX.
I''m new to rspec, and am currently using it with the Watir testing
library for web testing. I''m moving along at an ok pace so far, but I
had a question.
I just realized I could require ''spec'' and forego running scripts from
the command line. However, this limits me in my output formats. Is
there a way that I can specify which format
2007 May 03
1
unexpected failures with --reverse
I''m having trouble figuring out why one of my specs passes when run
without --reverse and then fails with --reverse. What am I missing?
I''m using the plugin versions of both rspec and rspec_on_rails 0.9.2.
Here is the offending spec (Bill is an ActiveRecord model in a Rails app):
----------
describe Bill, " when valid" do
def valid_bill_attributes
{ :uuid =>
2007 Aug 18
0
RSpec and acts_as_attachment
Hey guys,
I''m getting a weird error when trying to test something like the
following. It''s a model that is using acts_as_attachment but the
weird thing is the equivalent Test::Unit case passes. Does anyone
have any ideas?
Best,
Dave
# it was a Test::Unit case first
def test_should_be_invalid_without_file
UserFile.any_instance.expects(:with_image).never
2007 Sep 05
5
RSpec for dummies screencast?
Does anyone know of any RSpec screencasts for dummies, like me :)
I have a Java background, but I have never written a java test in my
life. I''ve never learned about TDD or BDD so I''m totally blank on
everything that has anything to do with testing and stuff.
Where should I start?!? ;)
Christian...
--~--~---------~--~----~------------~-------~--~----~
You received this
2009 Mar 23
5
Rspec weird behaviour
Hi,
I recently migrated from classic rails testing to Rspec, so I am
pretty new to the framework and still learning. I am getting weird
errors on an ActiveRecord model test, here is the basic class model
definition:
class Size < ActiveRecord::Base
has_many :quantities, :dependent => :destroy
validates_presence_of :name
validates_uniqueness_of :name, :case_sensitive => false
end
2007 May 27
12
Checking for Range
how would you check for a range using rspec?
person.password.range.should == Range.new(5..40) <- this doesn''t work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070527/4d8cb007/attachment-0001.html
2008 Jan 11
0
Peepcode RSpec User Stories
http://peepcode.com/products/rspec-user-stories
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568 6684
Mobile: +64 21 435 586
Email: smingins at elctech.com
AIM: ShaneMingins
Skype: shane.mingins
(866) 863-7365 Tel - Santa Barbara Office
(866) 893-1902 Fax - Santa Barbara Office
+44 020 7504 1346 Tel - London Office
+44 020 7504 1347 Fax -