Hi
First of all thanks everyone for helping.
# app/helpers/reports_helper.rb
def show_sold_by_options?
if is_lead_report
is_org_user?
end
end
where is_org_user? is a method which is defined in
application_controller.rb file. When I write specs for this method as below
#spec/helpers/reports_helper.rb
it "should returns true for lead_reports if user is organization user" do
helper.stub(:params).and_return({action: 'lead_source'})
expect(helper.show_sold_by_options?).to eq(true)
expect(helper).to have_received(:is_org_user?)
end
output:
Failure/Error: expect(helper.show_sold_by_options?).to eq(true)
NoMethodError:
undefined method `is_org_user?' for
#<#<Class:0x0000000b463470>:0x0000000b66d6f8>
Thank You
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/7739b907-2024-4c32-9fdb-7d9b783376fe%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.