Skip to content

Commit

Permalink
Walkthrough 4-3: Creating a Helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen-Mei Wu committed Jan 19, 2011
1 parent 90f4c8c commit beda22c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 4 additions & 0 deletions app/helpers/hotels_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
module HotelsHelper
def day_today()
Date.today.strftime("%A")
end
end

17 changes: 6 additions & 11 deletions spec/helpers/hotels_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
require 'spec_helper'

# Specs in this file have access to a helper object that includes
# the HotelsHelper. For example:
#
# describe HotelsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").should == "this that"
# end
# end
# end
describe HotelsHelper do
pending "add some examples to (or delete) #{__FILE__}"
describe "date formatter" do
it "should return the current day in English" do
day_today().should eq(Date.today.strftime("%A"))
end
end
end

0 comments on commit beda22c

Please sign in to comment.