Displaying 1 result from an estimated 1 matches for "total_v_px".
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 to extend my
spec models:
describe ApplicationHelper do
extend(ApplicationHelper)
it "doesn''t find what it''s looking for do
distribute(1,2,3,[4,5,6]).shou...