Displaying 4 results from an estimated 4 matches for "nzook".
Did you mean:
nook
2008 Mar 19
3
ApplicationHelper
When working with views, I use instance methods of ApplicationHelper:
# app/helpers/application_helper.rb:
module ApplicationHelper
def distribute(total, min, cutof, list)
[1,2,3]
end
end
# app/views/planner/_mta_colors.rhtml:
<td>
<%
...
dist = distribute(total_v_px, 4, 0, colors.collect{|color| color[1]})
...
%>
So to test the distribute method in ApplicationHelper, I have
2008 Mar 12
2
Warning: integrate_views and nested description groups
describe MyController do
integrate_views
describe "A common base senario" do
it "no longer integrates views" do
be_careful
end
end
end
integrate_views affects an attribute in the class formed by the describe
factory method. The second describe generates its own class, so
integrate_views is OFF at that level. I''ve already spent far, far too much
2008 Mar 17
1
Shouldn''t should return true?
''cause it doesn''t...
This is an issue for nested custom matchers, ie:
module CRFT
class RFT
def initialize(args)
blah
end
def matches?(target)
"Yeah, baby!"
end
end
def r_f_t(args)
RFT.new(args)
end
end
module CRLT
class RLT
include CRFT
def initialize(args)
blag
end
def matches?(target)
2008 Mar 12
2
Whence "post" in a description?
I''m having the exact problem described in this earlier post:
http://www.nabble.com/Odd-response.body-behavior-to12837556.html#a12837556
That is, after a post, response.body is just the controller/view string
("user/login" in my case).
Failing to find any answer on the web, I''m trying to trace execution, but
hitting a bit of a snag. I''m tracing the ancestry