[Git][noosfero/noosfero][master] 2 commits: replace feature tests of edit_environment_templates by functionals unit tests
Leandro Nunes
gitlab at mg.gitlab.com
Wed Jun 6 20:53:58 BRT 2018
Leandro Nunes pushed to branch master at Noosfero / noosfero
Commits:
b6d30758 by Leandro Nunes dos Santos at 2018-06-06T19:48:32Z
replace feature tests of edit_environment_templates by functionals unit tests
- - - - -
2d76a06c by Leandro Nunes at 2018-06-06T23:53:55Z
Merge branch 'removing-unstable-tests' into 'master'
replace feature tests of edit_environment_templates by functionals unit tests
See merge request noosfero/noosfero!1517
- - - - -
2 changed files:
- − features/edit_environment_templates.feature
- test/functional/templates_controller_test.rb
Changes:
=====================================
features/edit_environment_templates.feature deleted
=====================================
--- a/features/edit_environment_templates.feature
+++ /dev/null
@@ -1,49 +0,0 @@
-Feature: edit environment templates
- As an administrator
- I want to edit templates
-
- Background:
- Given that the default environment have all profile templates
- And I am logged in as admin
- And I am on the environment control panel
-
- @selenium
- Scenario: See links to edit all templates
- Given I follow "Profile templates"
- Then I should see "Person template"
- And I should see "Community template"
- And I should see "Enterprise template"
- And I should see "Inactive Enterprise template"
-
- @selenium
- Scenario: Go to control panel of person template
- Given I follow "Profile templates"
- And I follow exact "Person template"
- Then I should be on colivre.net_person_template's control panel
-
- @selenium
- Scenario: Go to control panel of enterprise template
- Given I follow "Profile templates"
- And I follow exact "Enterprise template"
- Then I should be on colivre.net_enterprise_template's control panel
-
- @selenium
- Scenario: Go to control panel of inactive enterprise template
- Given I follow "Profile templates"
- And I follow exact "Inactive Enterprise template"
- Then I should be on colivre.net_inactive_enterprise_template's control panel
-
- @selenium
- Scenario: Go to control panel of community template
- Given I follow "Profile templates"
- When I follow exact "Community template"
- Then I should be on colivre.net_community_template's control panel
-
- @selenium
- Scenario: Not see link to edit an unexistent template
- Given I follow "Profile templates"
- And that the default environment have no Inactive Enterprise template
- Then I should see "Person template"
- And I should see "Community template"
- And I should see "Enterprise template"
- And I should not see "Inactive enterprise template"
=====================================
test/functional/templates_controller_test.rb
=====================================
--- a/test/functional/templates_controller_test.rb
+++ b/test/functional/templates_controller_test.rb
@@ -187,5 +187,32 @@ class TemplatesControllerTest < ActionController::TestCase
assert_no_tag :a, '', :attributes => {:href => "/admin/templates/set_community_as_default?template_id=#{c1.id}"}
end
+ should 'display a link for manage person template' do
+ p1 = fast_create(Person, :is_template => true, :environment_id => environment.id)
+ p2 = fast_create(Person, :is_template => true, :environment_id => environment.id)
+
+ get :index
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{p1.identifier}/}}
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{p2.identifier}/}}
+ end
+
+ should 'display a link for manage enterprise template' do
+ e1 = fast_create(Enterprise, :is_template => true, :environment_id => environment.id)
+ e2 = fast_create(Enterprise, :is_template => true, :environment_id => environment.id)
+
+ get :index
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{e1.identifier}/}}
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{e2.identifier}/}}
+ end
+
+ should 'display a link for manage community template' do
+ c1 = fast_create(Community, :is_template => true, :environment_id => environment.id)
+ c2 = fast_create(Community, :is_template => true, :environment_id => environment.id)
+
+ get :index
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{c1.identifier}/}}
+ assert_tag :tag => 'td', :child => {:tag => 'a', :attributes => {:href => /myprofile\/#{c2.identifier}/}}
+ end
+
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/4b92c65c68761369a070b3ddeac532861ef42f97...2d76a06cb685f1f4a057172ce85baada532bae1b
--
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/4b92c65c68761369a070b3ddeac532861ef42f97...2d76a06cb685f1f4a057172ce85baada532bae1b
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180606/9876c839/attachment-0001.html>
More information about the Noosfero-dev
mailing list