Hi all,

I am new to testing stuffs like TDD and BDD. So, I am facing issues in
writing test cases for my plugin:
https://github.com/suryart/spree_active_sale on branch => "1-1-0-testing".

Issue I am facing are:
1) How do I test admin controllers stuff?? When I used stub_authorization!
but it gives me some error saying "Failure/Error: Unable to find matching
line from backtrace” with (<Spree::ActiveSale_1600>).authorize!(any args)
where "<Spree::ActiveSalesController_1600>" is mocked model. What is a best
way to test related with admin interface?

2) Yesterday I'd commit some test cases, and I see something unrelated on
Travis. Here is the link:
https://travis-ci.org/suryart/spree_active_sale/jobs/5026436 Which says:
Could not find table 'spree_configurations'. As, I do not see this error on
my system when I follow the same process as on Travis with vanilla app.
Kindly suggest if I am doing something wrong here.

3) It will be really grateful if you can share any good testing process to
be followed for spree extensions related with admin stuffs, as I can not
find any on internet. Or maybe unfamiliar with them.

--

Please consider the environment before printing this email.

Regards,
Surya

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Surya at Feb 25, 2013 at 5:00 pm
    2nd issue is resolved, it was a small typo with the configuration class in
    engine.rb. I am still facing issue with testing admin controllers, any
    suggestions?
    On Mon, Feb 25, 2013 at 12:38 PM, Surya wrote:

    Hi all,

    I am new to testing stuffs like TDD and BDD. So, I am facing issues in
    writing test cases for my plugin:
    https://github.com/suryart/spree_active_sale on branch =>
    "1-1-0-testing".

    Issue I am facing are:
    1) How do I test admin controllers stuff?? When I
    used stub_authorization! but it gives me some error saying "Failure/Error:
    Unable to find matching line from backtrace” with
    (<Spree::ActiveSale_1600>).authorize!(any args) where "<Spree::ActiveSalesController_1600>"
    is mocked model. What is a best way to test related with admin interface?

    2) Yesterday I'd commit some test cases, and I see something unrelated on
    Travis. Here is the link:
    https://travis-ci.org/suryart/spree_active_sale/jobs/5026436 Which says:
    Could not find table 'spree_configurations'. As, I do not see this error on
    my system when I follow the same process as on Travis with vanilla app.
    Kindly suggest if I am doing something wrong here.

    3) It will be really grateful if you can share any good testing process to
    be followed for spree extensions related with admin stuffs, as I can not
    find any on internet. Or maybe unfamiliar with them.

    --

    Please consider the environment before printing this email.

    Regards,
    Surya


    --

    Please consider the environment before printing this email.

    Regards,
    Surya

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nate Lowrie at Feb 25, 2013 at 7:25 pm
    It all depends on what my admin controllers are doing. In the case of my spree_discontinue_products
    plugin <https://github.com/FineLineAutomation/spree_discontinue_products> I
    don't test the admin code at all because it's literally just a deface
    override on an admin view. Even if I had my own admin controller for a
    model, unless I was doing a specific action in the controller outside of
    the normal CRUD processes I probably wouldn't test it at all. If you want
    to test it, the most common thing would be to do a request test where you
    hit the admin page, change/create your sample record, and then hit the
    frontend page to verify the record. I almost always test the frontend page
    by itself anyways, so it's not a big deal for me if the admin functionality
    goes untested.

    You might have a look at Spree's tests themselves. They can give a lot of
    insight on writing specific kinds of tests.

    Regards,

    Nate
    On Monday, February 25, 2013 12:00:14 PM UTC-5, Surya wrote:

    2nd issue is resolved, it was a small typo with the configuration class in
    engine.rb. I am still facing issue with testing admin controllers, any
    suggestions?

    On Mon, Feb 25, 2013 at 12:38 PM, Surya <raj.s...@gmail.com <javascript:>>wrote:
    Hi all,

    I am new to testing stuffs like TDD and BDD. So, I am facing issues in
    writing test cases for my plugin:
    https://github.com/suryart/spree_active_sale on branch =>
    "1-1-0-testing".

    Issue I am facing are:
    1) How do I test admin controllers stuff?? When I
    used stub_authorization! but it gives me some error saying "Failure/Error:
    Unable to find matching line from backtrace” with
    (<Spree::ActiveSale_1600>).authorize!(any args) where "<Spree::ActiveSalesController_1600>"
    is mocked model. What is a best way to test related with admin interface?

    2) Yesterday I'd commit some test cases, and I see something unrelated on
    Travis. Here is the link:
    https://travis-ci.org/suryart/spree_active_sale/jobs/5026436 Which says:
    Could not find table 'spree_configurations'. As, I do not see this error on
    my system when I follow the same process as on Travis with vanilla app.
    Kindly suggest if I am doing something wrong here.

    3) It will be really grateful if you can share any good testing process
    to be followed for spree extensions related with admin stuffs, as I can not
    find any on internet. Or maybe unfamiliar with them.

    --

    Please consider the environment before printing this email.

    Regards,
    Surya


    --

    Please consider the environment before printing this email.

    Regards,
    Surya
    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedFeb 25, '13 at 7:09a
activeFeb 25, '13 at 7:25p
posts3
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Surya: 2 posts Nate Lowrie: 1 post

People

Translate

site design / logo © 2022 Grokbase