Skip to content

Commit

Permalink
moving integration appart from unit
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Aug 17, 2010
1 parent b91e60e commit a34a1b9
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions tests/integration/server/core_ext/array_spec.rb
Expand Up @@ -3,13 +3,10 @@

context Array do

before(:each) do
@array = []
3.times { @array << AtomifiedModel.new }
end

it "creates an Atom feed based on the array elements" do
feed = @array.to_atom
array = []
3.times { array << AtomifiedModel.new }
feed = array.to_atom
feed = feed.to_xml
feed.should include("<feed xmlns=\"http://www.w3.org/2005/Atom\"")
feed.should include("<published>2010-05-03T16:29:26Z</published>")
Expand All @@ -19,7 +16,7 @@

it "accepts a block to customize fields" do

feed = @array.to_atom do |f|
feed = [].to_atom do |f|
f.title = "customized title"
f.authors << Restfulie::Common::Representation::Atom::Person.new("author", :name => 'John Doe')
end.to_xml
Expand All @@ -29,15 +26,4 @@
feed.should include("<name>John Doe</name")
end

it "get the max time to update the items" do
Album.create(:title => 'Array test')
Album.update_all(:updated_at => Time.now - 1.day)
Album.first.update_attributes(:updated_at => Time.now)
Album.all.updated_at.should == Album.first.updated_at
end

it "custom field usinged to find max updated" do
album = Album.create(:title => 'Array test')
Album.all.updated_at(:created_at).to_i.should == album.created_at.to_i
end
end

0 comments on commit a34a1b9

Please sign in to comment.