Hi All,
Any Update on this topic.
I still not found any solution for a following method.
it "should be active if controller is same" do
tab_class('tab').should include('active')
end
Regards,
Salil
--
Posted via http://www.ruby-forum.com/.
__
> http://github.com/bmabey/email-spec/blob/cdf3eeda4d28ef8b35bbce8af9ca7c493528332d/examples/rails_root/spec/models/user_mailer_spec.rb
>
> -Ben
I try following and it works. i don't know how but it pass the test
gives me 100% coverage and also i receive a test email.
describe ApplicationHelpe
> Try with that:
>
> controller.stub!(:params).and_return({:controller =>
> 'your_controller_name'})
Nah it doesn't work out,gives same error.
neways thanx for the info.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-user
Fernando Perez wrote:
>> it gives me following error
>>
>> undefined local variable or method `params' for
>
> That's normal. Remember that params exists because there is an http
> request issued. In your spec, you don't tell Rspec anything about any
> request. So you could create a mock for pa
following is the method of the helper
module ApplicationHelper
def tab_class(tab)
'class="active"' if tab == params[:controller]
end
end
i write the spec method as follows
describe ApplicationHelper do
it "should be active if controller is same" do
tab_class('royalty_statement').s
How to write a spec file for a following helper
module ArtistsHelper
def round_to(x)
(self * 10**x).round.to_f / 10**x
end
end
Regards
salil
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://
how to write a spec for an actionmailer method.
following is the method of action controller.
class Notifier < ActionMailer::Base
def conta(username ,adresseemail,code)
@subject = 'Admin Confirmation Mail'
@recipients = adresseemail
@body["Username"]= username
@body["adressee