Commit 7d93627a1e8b9604fbb1c6eeac29542b7c1870bf

Authored by Daniela Feitosa
1 parent 10f091ec

Fixed failing tests

features/edit_environment_templates.feature
1 Feature: edit environment templates 1 Feature: edit environment templates
2 As an administrator 2 As an administrator
3 - I want edit templates 3 + I want to edit templates
4 4
5 Background: 5 Background:
6 Given that the default environment have all profile templates 6 Given that the default environment have all profile templates
@@ -9,37 +9,37 @@ Feature: edit environment templates @@ -9,37 +9,37 @@ Feature: edit environment templates
9 Given I am logged in as admin 9 Given I am logged in as admin
10 When I follow "Administration" 10 When I follow "Administration"
11 And I follow "Edit Templates" 11 And I follow "Edit Templates"
12 - Then I should see "Edit Person Template" link  
13 - And I should see "Edit Community Template" link  
14 - And I should see "Edit Enterprise Template" link  
15 - And I should see "Edit Inactive Enterprise Template" link 12 + Then I should see "Person template" link
  13 + And I should see "Community template" link
  14 + And I should see "Enterprise template" link
  15 + And I should see "Inactive Enterprise template" link
16 16
17 Scenario: Go to control panel of person template 17 Scenario: Go to control panel of person template
18 Given I am logged in as admin 18 Given I am logged in as admin
19 When I follow "Administration" 19 When I follow "Administration"
20 And I follow "Edit Templates" 20 And I follow "Edit Templates"
21 - And I follow "Edit Person Template" 21 + And I follow "Person template"
22 Then I should be on Person template's control panel 22 Then I should be on Person template's control panel
23 23
24 Scenario: Go to control panel of enterprise template 24 Scenario: Go to control panel of enterprise template
25 Given I am logged in as admin 25 Given I am logged in as admin
26 When I follow "Administration" 26 When I follow "Administration"
27 And I follow "Edit Templates" 27 And I follow "Edit Templates"
28 - And I follow "Edit Enterprise Template" 28 + And I follow "Enterprise template"
29 Then I should be on Enterprise template's control panel 29 Then I should be on Enterprise template's control panel
30 30
31 Scenario: Go to control panel of inactive enterprise template 31 Scenario: Go to control panel of inactive enterprise template
32 Given I am logged in as admin 32 Given I am logged in as admin
33 When I follow "Administration" 33 When I follow "Administration"
34 And I follow "Edit Templates" 34 And I follow "Edit Templates"
35 - And I follow "Edit Inactive Enterprise Template" 35 + And I follow "Inactive enterprise template"
36 Then I should be on Inactive Enterprise template's control panel 36 Then I should be on Inactive Enterprise template's control panel
37 37
38 Scenario: Go to control panel of community template 38 Scenario: Go to control panel of community template
39 Given I am logged in as admin 39 Given I am logged in as admin
40 When I follow "Administration" 40 When I follow "Administration"
41 And I follow "Edit Templates" 41 And I follow "Edit Templates"
42 - And I follow "Edit Community Template" 42 + And I follow "Community template"
43 Then I should be on Community template's control panel 43 Then I should be on Community template's control panel
44 44
45 Scenario: Not see link to edit an unexistent template 45 Scenario: Not see link to edit an unexistent template
@@ -47,7 +47,7 @@ Feature: edit environment templates @@ -47,7 +47,7 @@ Feature: edit environment templates
47 And I am logged in as admin 47 And I am logged in as admin
48 When I follow "Administration" 48 When I follow "Administration"
49 And I follow "Edit Templates" 49 And I follow "Edit Templates"
50 - Then I should see "Edit Person Template" link  
51 - And I should see "Edit Community Template" link  
52 - And I should see "Edit Enterprise Template" link  
53 - And I should not see "Edit Inactive Enterprise Template" link 50 + Then I should see "Person template" link
  51 + And I should see "Community template" link
  52 + And I should see "Enterprise template" link
  53 + And I should not see "Inactive enterprise template" link
test/unit/comment_test.rb
@@ -400,10 +400,12 @@ class CommentTest < ActiveSupport::TestCase @@ -400,10 +400,12 @@ class CommentTest < ActiveSupport::TestCase
400 should 'update article activity when add a comment' do 400 should 'update article activity when add a comment' do
401 profile = create_user('testuser').person 401 profile = create_user('testuser').person
402 article = create(TinyMceArticle, :profile => profile) 402 article = create(TinyMceArticle, :profile => profile)
403 - action = article.activity  
404 - time = action.updated_at  
405 403
406 - Time.stubs(:now).returns(time + 1.day) 404 + ActionTracker::Record.record_timestamps = false
  405 + article.activity.update_attribute(:updated_at, Time.now - 1.day)
  406 + ActionTracker::Record.record_timestamps = true
  407 +
  408 + time = article.activity.updated_at
407 409
408 comment = create(Comment, :source => article, :author => profile) 410 comment = create(Comment, :source => article, :author => profile)
409 assert_equal time + 1.day, article.activity.updated_at 411 assert_equal time + 1.day, article.activity.updated_at