Hi Fahim,
Have you looked at the documentation here [https://www.relishapp.com/rspec/]
? There are lots of great examples.
Regards,
Ken
On Thu, Aug 2, 2012 at 1:14 AM, Fahim Patel wrote:
> i implement all this question but i dont have knowledge perfectly
> ...ok
>
> explain with e
Hi Matt,
On Wed, Mar 7, 2012 at 2:22 AM, Matt Wynne wrote:
> Hi all,
>
> I'm spec'ing a method that yields a value. Right now, I spec it like this:
>
> result = nil
> thing.do_stuff { |value| result = value }
> result.should == expected
>
> This feels like too much ceremony. What I wa
Hi Justin,
On Tue, Feb 21, 2012 at 4:03 AM, Justin Ko wrote:
> Would you like to do this?
>
> account.should_receive_chain(:users, :active, :first)
>
>
I would love this syntax. I find that I usually resort to stub_chain and
lose the ability to check that the object received a particular message
I think you were closer when you had:
--- Source code extract starts -
context 'saves updates to an existing part object successfully' do
before do
part =
double('part').stub(:update_
attributes).and_return(true)
end
it 'does its job in saving
When calling get/post/etc, the second optional parameter is a hash
representing the "params" hash.
So, in order to test the conditional(s) in your controller, you should
write:
get :index, :alpha => true #test the first conditional
In another example, pass in :beta => true like this:
get
What problems are you running into?
It appears that you should stub out Widget.all before all examples, unless
you really want to hit the database.
Ken
2011/3/18 Sid Wood
> Hi there,
>
> I'm fairly new to RSpec, and DataMapper and I'm trying to write a
> controller spec for an index action t
I assume you're asking in the context of Rails?
If so, take a look at Spork[1]. You can choose what you want to load once,
and what you want to load before every spec.
Ken
---
[1] https://github.com/timcharper/spork
2011/3/10 phani kumar
>
>
> Hi Guys,
>
> How can run the single spec file wi
You should be able to call:
controller.stub(:some_method)
My suspicion is what you passed to the describe method.
Instead of:
describe "save attachment"
pass the controller name, without quotes:
describe DynamicFlowsController
then
controller.stub
should work, and then you can refactor t