Phillip Koebbe wrote:
>
> Namatra,
Sorry, I spelled your name wrong.
Namrata
Peace,
Phillip
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I'm a complete rSpec newbie, so I might be stepping in somewhere that I
don't belong, but...
Namatra, you said earlier that you were stubbing during setup, and you
shared the before_post method. In the spec, though, you are going a
:get. I'm not familiar with testing controllers yet (just get
Followed your example! Still getting the following error -
Spec::Mocks::MockExpectationError in 'ArticlesController should list all
article
s'
Mock 'ArticlesController' expected :find_city with (any args) once, but
received
it 0 times
spec/controllers/articles_controller_spec.rb:3:
Thanks,
Namr
On Mon, Mar 3, 2008 at 11:21 PM, Namrata Tiwari <[EMAIL PROTECTED]> wrote:
> Here is the action -
>
> def list
> @articles = find_city.articles.paginate :all, :page =>
> params[:page] , :order => "live_on DESC", :conditions => { :type_for
> => "blog" }
> end
>
> and the spec -
>
> it
Here is the action -
def list
@articles = find_city.articles.paginate :all, :page =>
params[:page] , :order => "live_on DESC", :conditions => { :type_for
=> "blog" }
end
and the spec -
it "should list all articles 2" do
articles = mock("articles")
get :list
controller.shou
On Mon, Mar 3, 2008 at 5:22 AM, Namrata Tiwari <[EMAIL PROTECTED]> wrote:
>
> >
> > If the code is the same as it was in the first post in this thread,
> > it's because the action is taking place before setting the
> > expectations.
>
> Yes, it is the same. As you have suggested earlier.
> I
>
> If the code is the same as it was in the first post in this thread,
> it's because the action is taking place before setting the
> expectations.
Yes, it is the same. As you have suggested earlier.
I am pasting the spec again.
#list
it "should list all articles" do
articles = mock("art
On Mon, Mar 3, 2008 at 5:04 AM, Namrata Tiwari <[EMAIL PROTECTED]> wrote:
> Matthias Hennemeyer wrote:
> > Am 03.03.2008 um 04:38 schrieb Namrata Tiwari:
> >
> >> The method find_city is in application controller. I think the method
> >> 'find_city' is being called but its expecting some args.
Matthias Hennemeyer wrote:
> Am 03.03.2008 um 04:38 schrieb Namrata Tiwari:
>
>> The method find_city is in application controller. I think the method
>> 'find_city' is being called but its expecting some args.
>>
> The message:
>
> Mock 'ArticlesController' expected :find_city with (any args) on
Am 03.03.2008 um 04:38 schrieb Namrata Tiwari:
> The method find_city is in application controller. I think the method
> 'find_city' is being called but its expecting some args.
>
The message:
Mock 'ArticlesController' expected :find_city with (any args) once, but
received
it 0 times
means th
Bryan Ray wrote:
> It has to do with your "find_city" method. You spec is expecting it to
> be
> called from controller, hence:
>
> controller.should_receive(:find_city)
>
> Where is that method and why isn't it being called should be your next
> questions based on the code and spec you've paste
It has to do with your "find_city" method. You spec is expecting it to be
called from controller, hence:
controller.should_receive(:find_city)
Where is that method and why isn't it being called should be your next
questions based on the code and spec you've pasted.
Hope that helps, buddy.
On Th
Thanks Mr David for your reply. This gives me a better understanding of
so called train wreck. I am still facing problems with this spec.
firstly - I think I need to put a colon before order(e.g. :order=>
"live_on DESC")
#list
it "should list all articles" do
articles = mock("articles")
On Thu, Feb 28, 2008 at 3:54 AM, Namrata Tiwari <[EMAIL PROTECTED]> wrote:
> This action will list all the articles according to city. Please, can
> some one guide me through this spec.
>
> def list
> @articles = find_city.articles.paginate :all, :page => params[:page]
This line has what we c
This action will list all the articles according to city. Please, can
some one guide me through this spec.
def list
@articles = find_city.articles.paginate :all, :page => params[:page]
, :order
=> "live_on DESC", :conditions => { :type_for => "blog" }
end
it "should list all articles" do
15 matches
Mail list logo