Closed AteqEjaz closed 11 years ago
Hey @AteqEjaz thx for reporting. I'll look into this tonight. I don't have time to look into it sooner. Do you maybe have some more information ? like which version of spree and a longer stacktrace ? that would make debugging easier.
Thanks johnab,
I'm using spree 2.0.0 and i was just trying to test its controller create method.like
it "responds successfully with an HTTP 200 status code" do
spree_post :create , chimpy_subscriber: valid_attributes
expect(response).to be_success
expect(response.status).to eq(200)
end
I found root cause in my case which is list.rb line 40. if i put a check over there def find_list_id(name) @api.lists["data"].detect { |r| r["name"] == name }["id"] if @api.lists["data"].present? end this error removes But subscription_controller following line throws error undefined url.
respond_with @subscriber, location: request.referer.
Let me know if i'm missing some configuration?
@AteqEjaz Usually in a controller spec you would mock out the model layer. Without mocking, you would need a bunch of setup code to make this work.
Hi guys,
Spree::Chimpy::SubscribersController is throwing following error in create method any idea?
*\ NoMethodError Exception: undefined method `detect' for nil:NilClass.
Thanks,