Hi All,
I'm nearly ready with the abuse report stuff.
Anyway, at the moment it break several rake spec tests.
In my controller I use something like this:
message = Message.new(params[:message].merge(:sender =>
current_person,
:recipient =>
person, :sender_ip => request.env_table["REMOTE_ADDR"]))
On several tests I get a error like this:
NoMethodError in 'CommentsController wall comments should associate a
person to a comment'
undefined method `env_table' for #<ActionController::TestRequest:
0xb6ee323c>
/home/ber/rails/insoshi/app/controllers/comments_controller.rb:22:in
`create'
./spec/controllers/comments_controller_spec.rb:94:
./spec/controllers/comments_controller_spec.rb:93:
It's look like the rake tests don't set any environment variable
related to HTTP.
I tried this:
def handle_replies(message, recipient, sender)
login_as(recipient)
@request.env_table['REMOTE_ADDR'] = '10.0.1.1'
lambda do
post :create, :message => { :subject => "The subject",
:content => "This is a reply",
:parent_id => message },
:person_id => sender
assigns(:message).should be_reply
end.should change(Message, :count).by(1)
end
But it doesn't help!
Has anybody an idea?
Cheers,
E
--~--~---------~--~----~------------~-------~--~----~
Insoshi developer site: http://dogfood.insoshi.com/
Insoshi documentation: http://docs.insoshi.com/
You received this message because you are subscribed to the Google
Groups "Insoshi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/insoshi?hl=en
-~----------~----~----~----~------~----~------~--~---