Skip to content

Commit

Permalink
fixes version spec where update was not triggered by change to update…
Browse files Browse the repository at this point in the history
…d_at field
  • Loading branch information
warp committed Jan 7, 2015
1 parent bec7636 commit 6e41378
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/models/polymorphic/version_spec.rb
Expand Up @@ -121,7 +121,7 @@
end

it "updating a new task should not add it to recently viewed items list" do
@task.update_attribute(:updated_at, 1.second.ago)
@task.update(name: 'New Name')
@versions = Version.where(@conditions)

expect(@versions.map(&:event).sort).to eq(%w(create update)) # but not view
Expand Down Expand Up @@ -178,7 +178,7 @@

it "should not show the create/update versions if the item is private" do
@item = FactoryGirl.create(:account, user: current_user, access: "Private")
@item.update_attribute(:updated_at, 1.second.ago)
@item.update(name: 'New Name')

@versions = Version.where({item_id: @item.id, item_type: @item.class.name})
expect(@versions.map(&:event).sort).to eq(%w(create update))
Expand All @@ -202,7 +202,7 @@
access: "Shared",
permissions: [ FactoryGirl.build(:permission, user: current_user, asset: @item) ]
)
@item.update_attribute(:updated_at, 1.second.ago)
@item.update(name: 'New Name')

@versions = Version.where({item_id: @item.id, item_type: @item.class.name})
expect(@versions.map(&:event).sort).to eq(%w(create update))
Expand Down Expand Up @@ -230,7 +230,7 @@
access: "Shared",
permissions: [ FactoryGirl.build(:permission, user: @user, asset: @item) ]
)
@item.update_attribute(:updated_at, 1.second.ago)
@item.update(name: 'New Name')

@versions = Version.where({item_id: @item.id, item_type: @item.class.name})
expect(@versions.map(&:event).sort).to eq(%w(create update))
Expand Down

0 comments on commit 6e41378

Please sign in to comment.