Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created September 17, 2009 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrchrisadams/188605 to your computer and use it in GitHub Desktop.
Save mrchrisadams/188605 to your computer and use it in GitHub Desktop.
module EventsHelper
def filter_check_button_path
params[:filter].blank? ? '/images/buttons/bt_search_for_events.gif' : '/images/buttons/bt_refine_this_search.gif'
end
end
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe EventsHelper do
#Delete this example and add some real ones or delete this file
it "should be included in the object returned by #helper" do
included_modules = (class << helper; self; end).send :included_modules
included_modules.should include(EventsHelper)
end
it "should return the 'refine image search' button if a search has been run" do
params = {}
params[:filter] = true
EventsHelper.filter_check_button_path.should be('/images/buttons/bt_search_for_events.gif')
end
end
should return the 'refine image search' button if a search has been run
undefined method `filter_check_button_path' for EventsHelper:Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment