From 7d93627a1e8b9604fbb1c6eeac29542b7c1870bf Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Thu, 9 Aug 2012 09:55:42 -0300 Subject: [PATCH] Fixed failing tests --- features/edit_environment_templates.feature | 26 +++++++++++++------------- test/unit/comment_test.rb | 8 +++++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/features/edit_environment_templates.feature b/features/edit_environment_templates.feature index 8ccde4b..dfe4d35 100644 --- a/features/edit_environment_templates.feature +++ b/features/edit_environment_templates.feature @@ -1,6 +1,6 @@ Feature: edit environment templates As an administrator - I want edit templates + I want to edit templates Background: Given that the default environment have all profile templates @@ -9,37 +9,37 @@ Feature: edit environment templates Given I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - Then I should see "Edit Person Template" link - And I should see "Edit Community Template" link - And I should see "Edit Enterprise Template" link - And I should see "Edit Inactive Enterprise Template" link + Then I should see "Person template" link + And I should see "Community template" link + And I should see "Enterprise template" link + And I should see "Inactive Enterprise template" link Scenario: Go to control panel of person template Given I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - And I follow "Edit Person Template" + And I follow "Person template" Then I should be on Person template's control panel Scenario: Go to control panel of enterprise template Given I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - And I follow "Edit Enterprise Template" + And I follow "Enterprise template" Then I should be on Enterprise template's control panel Scenario: Go to control panel of inactive enterprise template Given I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - And I follow "Edit Inactive Enterprise Template" + And I follow "Inactive enterprise template" Then I should be on Inactive Enterprise template's control panel Scenario: Go to control panel of community template Given I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - And I follow "Edit Community Template" + And I follow "Community template" Then I should be on Community template's control panel Scenario: Not see link to edit an unexistent template @@ -47,7 +47,7 @@ Feature: edit environment templates And I am logged in as admin When I follow "Administration" And I follow "Edit Templates" - Then I should see "Edit Person Template" link - And I should see "Edit Community Template" link - And I should see "Edit Enterprise Template" link - And I should not see "Edit Inactive Enterprise Template" link + Then I should see "Person template" link + And I should see "Community template" link + And I should see "Enterprise template" link + And I should not see "Inactive enterprise template" link diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 6964fad..2847f8e 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -400,10 +400,12 @@ class CommentTest < ActiveSupport::TestCase should 'update article activity when add a comment' do profile = create_user('testuser').person article = create(TinyMceArticle, :profile => profile) - action = article.activity - time = action.updated_at - Time.stubs(:now).returns(time + 1.day) + ActionTracker::Record.record_timestamps = false + article.activity.update_attribute(:updated_at, Time.now - 1.day) + ActionTracker::Record.record_timestamps = true + + time = article.activity.updated_at comment = create(Comment, :source => article, :author => profile) assert_equal time + 1.day, article.activity.updated_at -- libgit2 0.21.2