Skip to content

Commit

Permalink
Merge pull request #157 from bobbytables/format-with-1.8
Browse files Browse the repository at this point in the history
Change time creation to adhere to ruby 1.8.
  • Loading branch information
Michael Bleigh committed Apr 3, 2012
2 parents ac00d2f + 434bab7 commit 5ee0f05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/grape/entity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

subject.expose :birthday, :format_with => :timestamp

model = { :birthday => Time.new(2012, 2, 27) }
model = { :birthday => Time.gm(2012, 2, 27) }
subject.new(mock(model)).as_json[:birthday].should == '02/27/2012'
end
end
Expand Down Expand Up @@ -239,11 +239,11 @@
let(:attributes){ {
:name => 'Bob Bobson',
:email => 'bob@example.com',
:birthday => Time.new(2012, 2, 27),
:birthday => Time.gm(2012, 2, 27),
:fantasies => ['Unicorns', 'Double Rainbows', 'Nessy'],
:friends => [
mock(:name => "Friend 1", :email => 'friend1@example.com', :fantasies => [], :birthday => Time.new(2012, 2, 27), :friends => []),
mock(:name => "Friend 2", :email => 'friend2@example.com', :fantasies => [], :birthday => Time.new(2012, 2, 27), :friends => [])
mock(:name => "Friend 1", :email => 'friend1@example.com', :fantasies => [], :birthday => Time.gm(2012, 2, 27), :friends => []),
mock(:name => "Friend 2", :email => 'friend2@example.com', :fantasies => [], :birthday => Time.gm(2012, 2, 27), :friends => [])
]
} }
subject{ fresh_class.new(model) }
Expand Down

0 comments on commit 5ee0f05

Please sign in to comment.