[noosfero/noosfero][master] 2 commits: context_content: fix tests
Victor Costa
gitlab at gitlab.com
Wed Mar 25 11:12:15 BRT 2015
Victor Costa pushed to master at Noosfero / noosfero
Commits:
c4afac0b by Victor Costa at 2015-03-25T10:32:08Z
context_content: fix tests
Return children ordered by name to improve visualization and avoid test randomness.
- - - - -
450e11f4 by Victor Costa at 2015-03-25T11:09:20Z
sub_organizations: fix selenium test
- - - - -
4 changed files:
- plugins/context_content/lib/context_content_plugin/context_content_block.rb
- plugins/context_content/test/unit/context_content_block_test.rb
- plugins/sub_organizations/features/sub_organizations_display.feature
- plugins/sub_organizations/lib/ext/create_enterprise.rb
Changes:
=====================================
plugins/context_content/lib/context_content_plugin/context_content_block.rb
=====================================
--- a/plugins/context_content/lib/context_content_plugin/context_content_block.rb
+++ b/plugins/context_content/lib/context_content_plugin/context_content_block.rb
@@ -58,7 +58,7 @@ class ContextContentPlugin::ContextContentBlock < Block
def contents(page, p=1)
return @children unless @children.blank?
if page
- @children = page.children.with_types(types).paginate(:per_page => limit, :page => p)
+ @children = page.children.with_types(types).order(:name).paginate(:per_page => limit, :page => p)
(@children.blank? && show_parent_content) ? contents(page.parent, p) : @children
else
nil
=====================================
plugins/context_content/test/unit/context_content_block_test.rb
=====================================
--- a/plugins/context_content/test/unit/context_content_block_test.rb
+++ b/plugins/context_content/test/unit/context_content_block_test.rb
@@ -51,18 +51,18 @@ class ContextContentBlockTest < ActiveSupport::TestCase
should 'show contents for next page' do
@block.limit = 2
folder = fast_create(Folder)
- article1 = fast_create(TinyMceArticle, :parent_id => folder.id)
- article2 = fast_create(TinyMceArticle, :parent_id => folder.id)
- article3 = fast_create(TinyMceArticle, :parent_id => folder.id)
+ article1 = fast_create(TinyMceArticle, :name => 'article 1', :parent_id => folder.id)
+ article2 = fast_create(TinyMceArticle, :name => 'article 2', :parent_id => folder.id)
+ article3 = fast_create(TinyMceArticle, :name => 'article 3', :parent_id => folder.id)
assert_equal [article3], @block.contents(folder, 2)
end
should 'show parent contents for next page' do
@block.limit = 2
folder = fast_create(Folder)
- article1 = fast_create(TinyMceArticle, :parent_id => folder.id)
- article2 = fast_create(TinyMceArticle, :parent_id => folder.id)
- article3 = fast_create(TinyMceArticle, :parent_id => folder.id)
+ article1 = fast_create(TinyMceArticle, :name => 'article 1', :parent_id => folder.id)
+ article2 = fast_create(TinyMceArticle, :name => 'article 2', :parent_id => folder.id)
+ article3 = fast_create(TinyMceArticle, :name => 'article 3', :parent_id => folder.id)
assert_equal [article3], @block.contents(article1, 2)
end
=====================================
plugins/sub_organizations/features/sub_organizations_display.feature
=====================================
--- a/plugins/sub_organizations/features/sub_organizations_display.feature
+++ b/plugins/sub_organizations/features/sub_organizations_display.feature
@@ -29,6 +29,7 @@ Feature: sub_organizations_display
And I follow "Manage sub-groups"
And I follow "Register a new sub-enterprise"
And I fill in "Name" with "Bart"
+ And I fill in "Address" with "bart"
And I press "Next"
Then I should see "Enterprise registration completed"
And I am logged in as admin
=====================================
plugins/sub_organizations/lib/ext/create_enterprise.rb
=====================================
--- a/plugins/sub_organizations/lib/ext/create_enterprise.rb
+++ b/plugins/sub_organizations/lib/ext/create_enterprise.rb
@@ -2,4 +2,5 @@ require_dependency 'create_enterprise'
class CreateEnterprise
settings_items :sub_organizations_plugin_parent_to_be
+ DATA_FIELDS << 'sub_organizations_plugin_parent_to_be'
end
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/793f7219d5a529771720214beb33d225779891e2...450e11f40ec7a2eb100a837bc5f1c571ddc16879
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150325/d2ea8250/attachment.html>
More information about the Noosfero-dev
mailing list