Commit 632dc3efb8c933fb7db39ab99d2152c7eaf1eb05

Authored by Rodrigo Souto
1 parent c84e0cab

article-versioning: fix tests after html attribute change

features/article_versioning.feature
@@ -34,8 +34,8 @@ Feature: article versioning @@ -34,8 +34,8 @@ Feature: article versioning
34 Given I am on article "Edited Article" 34 Given I am on article "Edited Article"
35 When I follow "All versions" 35 When I follow "All versions"
36 Then I should be on /joaosilva/edited-article/versions 36 Then I should be on /joaosilva/edited-article/versions
37 - And I should see "Version 1" within ".article-versions"  
38 - And I should see "Version 2" within ".article-versions" 37 + And I should see "Version 1" within "#article-versions"
  38 + And I should see "Version 2" within "#article-versions"
39 39
40 @selenium 40 @selenium
41 Scenario: see specific version 41 Scenario: see specific version
@@ -51,13 +51,13 @@ Feature: article versioning @@ -51,13 +51,13 @@ Feature: article versioning
51 Scenario: revert to a specific version generates a new version 51 Scenario: revert to a specific version generates a new version
52 Given I go to article "Edited Article" 52 Given I go to article "Edited Article"
53 When I follow "All versions" 53 When I follow "All versions"
54 - Then I should not see "Version 3" within ".article-versions" 54 + Then I should not see "Version 3" within "#article-versions"
55 And I follow "Version 1" 55 And I follow "Version 1"
56 And I follow "Revert to this version" 56 And I follow "Revert to this version"
57 And I press "Save" 57 And I press "Save"
58 Then I should see "Sample Article" within ".title" 58 Then I should see "Sample Article" within ".title"
59 When I follow "All versions" 59 When I follow "All versions"
60 - Then I should see "Version 3" within ".article-versions" 60 + Then I should see "Version 3" within "#article-versions"
61 61
62 Scenario: try to access versions of unexistent article 62 Scenario: try to access versions of unexistent article
63 Given I go to /joaosilva/unexistent-article/versions 63 Given I go to /joaosilva/unexistent-article/versions
test/functional/content_viewer_controller_test.rb
@@ -372,10 +372,7 @@ class ContentViewerControllerTest < ActionController::TestCase @@ -372,10 +372,7 @@ class ContentViewerControllerTest < ActionController::TestCase
372 page.body = 'test article edited'; page.save 372 page.body = 'test article edited'; page.save
373 373
374 get :article_versions, :profile => profile.identifier, :page => [ 'myarticle' ] 374 get :article_versions, :profile => profile.identifier, :page => [ 'myarticle' ]
375 - assert_tag :tag => 'ul', :attributes => { :class => 'article-versions' }, :descendant => {  
376 - :tag => 'a',  
377 - :attributes => { :href => "http://#{profile.environment.default_hostname}/#{profile.identifier}/#{page.path}?version=1" }  
378 - } 375 + assert_select "ul#article-versions a[href=http://#{profile.environment.default_hostname}/#{profile.identifier}/#{page.path}?version=1]"
379 end 376 end
380 377
381 should "fetch correct article version" do 378 should "fetch correct article version" do