I am having a lot of trouble figure out how to mock one my controller
methods. I was hoping someone might be able to help me.
---
Controller:
def create
@objective = current_user.objectives.create(params[:objective])
end
RSpec:
it "should create a new objec
Thanks! That was very helpful. I did do some searching but didn't
come up with that result.
On Oct 27, 11:16 am, Ashley Moran
wrote:
> On Oct 27, 2009, at 3:51 pm, drewB wrote:
>
> > As you can see, I am not mocking current_user.objectives.create so I
> > have to look at
I am using autotest with RSpec (autospec) and for some reason it
doesn't monitor files under the integration folder. Does anyone know
how to config autotest to monitor additional paths? I tried playing
with add_mapping in my .autotest but was not able to get it to work.
Thanks!
P.S. I know that
pm, David Chelimsky wrote:
> On Fri, Feb 19, 2010 at 6:53 PM, drewB wrote:
> > I am using autotest with RSpec (autospec) and for some reason it
> > doesn't monitor files under the integration folder. Does anyone know
> > how to config autotest to monitor addition
Whenever I use a matcher like response.should have_text in an
integration test I receive the following error:
undefined method `has' for #
Any idea why that is and how to fix it?
Thanks!
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rub
integration testing (outside
of cucumber) at least the way I have it set up.
On Feb 21, 3:50 pm, David Chelimsky wrote:
> On Sun, Feb 21, 2010 at 5:25 PM, drewB wrote:
> > Whenever I use a matcher like response.should have_text in an
> > integration test I receive the following erro
Any thoughts on how to get the matchers included?
On Feb 21, 4:23 pm, drewB wrote:
> I require webrat in spec_helper (Spork.prefork).
>
> versions:
>
> rails 2.1.2
> rspec 1.3.0
> rspec-rails 1.3.2
> ruby 1.8.7
>
> The file is located at 'spec/integration/landi
I need to create some integration tests without cucumber. Can anyone
point me in the right direction for how to do that in rails? I tried
creating specs under 'spec/integration/' but no matchers are being
included. I also tried rspec_integration plugin (http://github.com/
tricycle/rspec-integrati
Belwo is a spec that when used with the default spec_helper fails
with:
NoMethodError in 'test matchers should be able to find be_success'
undefined method `be_success' for
#
--
require 'spec_helper'
describe "test matchers" do
it "should be able to find be_success" do
get '/'
That fixed it! Thanks!
Any idea why that was needed for integration specs and not MVCs?
On Mar 1, 3:04 pm, David Chelimsky wrote:
> On Mon, Mar 1, 2010 at 4:59 PM, drewB wrote:
> > Belwo is a spec that when used with the default spec_helper fails
> > with:
>
> > NoMetho
Looks like I spoke too soon. I made a mistake when testing your
suggest. When I add that I still get the same failure.
On Mar 1, 4:06 pm, drewB wrote:
> That fixed it! Thanks!
>
> Any idea why that was needed for integration specs and not MVCs?
>
> On Mar 1, 3:04 pm, David C
There is a nice little gem that gives you desktop notifications of
your spec commands called test_noitifer (http://github.com/fnando/
test_notifier). I can get it to work by including require
"test_notifier/rspec" toward the top of my spec_helper, or by manually
including it in the command line li
stance of Array.
The error occurred while evaluating nil.map
On Mar 2, 11:33 am, David Chelimsky wrote:
> On Tue, Mar 2, 2010 at 1:22 PM, drewB wrote:
> > There is a nice little gem that gives you desktop notifications of
> > your spec commands called test_noitifer (htt
you didn't expect it! (NoMethodError)
You might have expected an instance of Array.
The error occurred while evaluating nil.map
No sure they same problem won't occur when using the option on the
command line.
On Mar 2, 1:13 pm, drewB wrote:
> I may not have been clear. When I
e?
On Mar 2, 3:54 pm, David Chelimsky wrote:
> On Tue, Mar 2, 2010 at 11:53 AM, drewB wrote:
> > Looks like I spoke too soon. I made a mistake when testing your
> > suggest. When I add that I still get the same failure.
>
> I just did the following using rails 2.3.
On Tue, Mar 2, 2010 at 3:13 PM, drewB wrote:
> > I may not have been clear. When I said if I add it to the top of my
> > spec.opts file, I meant adding, '--require "test_notifier/rspec"'.
>
> > Nevertheless, I tried you suggestion (a very good one).
>
Bug filed. Any idea about an earlier version that I might try?
On Mar 3, 10:38 am, David Chelimsky wrote:
> On Wed, Mar 3, 2010 at 12:24 PM, drewB wrote:
> > Let me start by saying thank you for the time you are spending helping
> > me.
>
> You're welcome.
>
I am writing some specs related to permissions for different kinds of
users. Every user has some common examples to test in many different
specs. For example, all users can view, and edit their profile.
Also, all users can view their own "history." So I have two spec
files, say profile_controlle
Is there a built-in matcher for a response returning a bad request
(e.g. header code in the 400s)? For example, "response.should
be_bad_request".
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Thanks!
On Mar 31, 11:37 pm, David Chelimsky wrote:
> On Apr 1, 2010, at 1:30 AM, drewB wrote:
>
> > Is there a built-in matcher for a response returning a bad request
> > (e.g. header code in the 400s)? For example, "response.should
> > be_bad_request".
&g
Occasionally, I find myself in a situation where I want to have a mock
obj returned if a method is called with a particular argument but
handled normally otherwise. For example, lets say I have a Model
named User and I am specing a controller that sends messages from one
user to another. When Use
21:35, David Chelimsky wrote:
>
>
>
> > On Apr 1, 2010, at 3:14 PM, drewB wrote:
>
> >> Occasionally, I find myself in a situation where I want to have a
> >> mock
> >> obj returned if a method is called with a particular argument but
> >> ha
stubs[id]
else
model.find_by_id(id)
end
end
end
#example below will return the mock_user if its id is search for
otherwise find will search as normal
mock_user = mock_model(User)
stub_find_for_specific_values(User, mock_user.id => mock_user)
On Apr 1, 3:12 pm, drewB wr
23 matches
Mail list logo