Displaying 20 results from an estimated 3000 matches similar to: "Spec failing [Possible Bug with kind_of? and instance_of?]"
2006 Jul 28
11
Forum
Im making forum and i have problem with paths.
Here is code:
http://pastie.caboo.se/6389
With this code, it works. But its a bit weird to use so many paths
function. For every path i need to make new function. So can you suggest
me something.
Tables are like here:
http://wiki.rubyonrails.com/rails/pages/ForumExample
--
Posted via http://www.ruby-forum.com/.
2007 Jun 21
9
it_should_behave_like
I''m trying to use it_should_behave_like, and something seems to be wonky
with the syntax. When I add :shared=>true, the DSL complains that the next
line is the fixture declaration:
/vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:137:in
`method_missing'': undefined method `fixtures'' for
#<Spec::DSL::EvalModule:0x324a2cc> (NoMethodError)
Here''s the
2007 Aug 12
3
Scope and specing models
Hello all, I''m currently having an issue with some specs, specifically scope
issues (probably more of a scope issue than a spec issue at this point)...
Here''s the error:
ActiveRecord::AssociationTypeMismatch in ''A new User should know what role
it has''
Role expected, got NilClass
D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in
2007 Aug 14
4
(no subject)
How would you spec out something like the following:
def a_method
x = Class.new do
include Enumerable
end
# do something here with x
end
describe "The Anonymous Class" do
before :each do
@anonymous_class = mock Class
Class.stub!(:new).and_return @anonymous_class
end
it "should create a new anonymous class" do
2008 Jun 01
6
!= again
Hey!
I have implemented a quick solution for the should != .. , should !
~ ... ''problem''.
It uses source code inspection (I think it''s the only way) and i''ve
done some
benchmarking to see if it''s really that slow.
A direct comparison of
running ''1.should == 1''
with the unmodified rspec source against the rspec-version with
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY
out the repeated parts of my forms and put them in common/form and
render the form elements via another partial in controller_name/_form.
Here''s the first form
# app/views/common/form
<% form_for ... do |f| -%>
<%= render :partial => "params[:controller]/form", :object => f
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all,
I feel like I''m missing something really easy and I''m just not seeing
it.
I''m using the restful_authentication plugin and have a User model. Uesr
has_many :things and Thing belongs_to :user.
That''s it.
I did a "script/generate rspec_scaffold thing" to generate all the
necessary bits. The "rake db:migrate" to create the db.
At
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2007 May 31
28
Another attempt for a succinct model validation DSL
On 5/28/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> The behaviour you''re trying to describe is that the User should
> require that passwords bear certain qualities - in this case a length
> between 5 and 40. So you need to ask yourself how the User should
> behave when this requirement is violated, and then specify that it
> behaves that way.
>
>
2007 Aug 07
4
Problems with raising errors on a mocked object
I''m trying to mock a object to raise a certain error. By doing so I
get a ArgumentError on ActiveRecord''s save! method:
http://pastie.caboo.se/85628
I''ve tried to debug it but just can''t seem to find what I''m doing
wrong. Any help is greatly appreciated.
Cheers,
Eivind Uggedal
2007 Jun 07
6
Problem with response.should render_template
Hello, I have problems with this spec controllers:
http://pastie.caboo.se/68634
when I run:
rake spec:controllers
I get this error:
...............F......
1)
''DocTypeController should update and redirect to show'' FAILED
expected redirect to {:action=>"show", :id=>1}, got redirect to
2007 Oct 19
11
Patch idea for rspec_on_rails
I recently wrote a matcher for testing AR associations which allows
you to specify things like:
Foo.should have_many(:bars).through(:bazes)
I''m pretty darned proud of it and a couple of people have suggested
that I should submit it to the rspec_on_rails project. Before I go to
the trouble of writing out rdoc and fully spec''ing it, I just wanted
to make sure this was
2007 Jun 28
23
DRYing link_to with a symbol
Hi, I just put in a patch that allows you to DRY up this:
<%= link_to @company.name, @company %>
to this:
<%= link_to :name, @company %>
The symbol indicates the method to be called on the object passed in
the link_to options.
http://dev.rubyonrails.org/ticket/8789
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
2007 Aug 06
5
Problems with array mock
Hi everyone,
I''m trying this in my helper spec and it didn''t work:
@curr_odontogram.should_receive(''photos[1]'').and_return(@photo)
and the error is:
SyntaxError in ''PersonHelper Deberia devolverme un link para eliminar una foto''
compile error
/home/gramos/src/rails/r-dental/config/../vendor/plugins/rspec/lib/spec/mocks/proxy.rb:99:
syntax
2007 Jun 05
6
Help with spec controller
Hello,
I haven''t been able to create a controller spec.
You can see the code here:
http://pastie.caboo.se/67980
The error message I''m getting is:
Spec::Mocks::MockExpectationError in ''PersonController should tell the Person
model to create a new person on POST to create''
Mock ''person'' received unexpected message :save with (no args)
2007 Apr 12
19
Multiple Model Search
[from out-of-band communication with steven, just for the record]
Hi!
On Wed, Apr 11, 2007 at 01:47:49PM +0200, Steven Garcia wrote:
> Hey Jens,
>
[..]
>
> 1. Is the Search model just an Active Record object or do I need to
> set up a database for it as well (if so then with what columns)?
No, that search model is just a plain class that backs your search form.
If you want to
2007 Oct 25
1
Mocking within a Proc/Block?
The following works:
it "should evaluate a passed in block in the context of the
interview object" do
block = Proc.new { raise unless self.is_a?
(Interview) }.should_not raise_error
Interview.create(:title => "Text", &block)
end
However, the following does not:
it "should evaluate a passed in block in the context of the
interview
2007 Aug 02
3
Code works in console but fails test?
So I have message model and each user has many messages. When I run
user.messages in the console it returns correctly, however in the test
it returns and empty collection? Any thoughts. All the sql is being
generate correctly, I checked the log. Here''s a pastie with the code
in question.
http://pastie.caboo.se/84337
--~--~---------~--~----~------------~-------~--~----~
You received
2007 Sep 20
4
issues submitting a search form
Hello to the list and thanks to Aaron for the cool software.
I''ve been fooling around with Mechanize and Hpricot for a couple of
days and from the docs I''ve read, the following code SHOULD work but
doesn''t. I''ve tried the same code on a couple of different sites and I
get the same exception for each. Any pointers or suggestions are
appreciated.
2008 May 03
6
Everyone Using Rspec Autotest?
I haven''t been spec''ing lately, but been hopping back on and adding
autotest.
However I get an error:
http://pastie.caboo.se/177538/wrap
I also noticed a post by Scott and there was mention of rspec_autotest.
Is this is what everyone is using?
http://svn.caldersphere.net/svn/main/plugins/rspec_autotest/