Commit a9ffbc6e796603f45a96cd4559c6a3d7eda79618
Exists in
master
and in
22 other branches
Merge branch 'master' into rails3
Showing
29 changed files
with
61 additions
and
65 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
@@ -33,6 +33,7 @@ class ContentViewerController < ApplicationController | @@ -33,6 +33,7 @@ class ContentViewerController < ApplicationController | ||
33 | process_forum_terms_of_use(user, params[:terms_accepted]) | 33 | process_forum_terms_of_use(user, params[:terms_accepted]) |
34 | elsif is_a_forum_topic?(@page) | 34 | elsif is_a_forum_topic?(@page) |
35 | redirect_to @page.parent.url unless @page.parent.agrees_with_terms?(user) | 35 | redirect_to @page.parent.url unless @page.parent.agrees_with_terms?(user) |
36 | + return | ||
36 | end | 37 | end |
37 | 38 | ||
38 | # At this point the page will be showed | 39 | # At this point the page will be showed |
app/models/article.rb
@@ -2,7 +2,7 @@ require 'hpricot' | @@ -2,7 +2,7 @@ require 'hpricot' | ||
2 | 2 | ||
3 | class Article < ActiveRecord::Base | 3 | class Article < ActiveRecord::Base |
4 | 4 | ||
5 | - attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions | 5 | + attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent, :allow_members_to_edit, :translation_of_id, :language, :license_id, :parent_id, :display_posts_in_current_language, :category_ids, :posts_per_page, :moderate_comments, :accept_comments, :feed, :published, :source, :highlighted, :notify_comments, :display_hits, :slug, :external_feed_builder, :display_versions, :external_link |
6 | 6 | ||
7 | acts_as_having_image | 7 | acts_as_having_image |
8 | 8 |
app/models/forum.rb
@@ -3,7 +3,7 @@ class Forum < Folder | @@ -3,7 +3,7 @@ class Forum < Folder | ||
3 | acts_as_having_posts :order => 'updated_at DESC' | 3 | acts_as_having_posts :order => 'updated_at DESC' |
4 | include PostsLimit | 4 | include PostsLimit |
5 | 5 | ||
6 | - attr_accessible :has_terms_of_use, :terms_of_use | 6 | + attr_accessible :has_terms_of_use, :terms_of_use, :allows_members_to_create_topics |
7 | 7 | ||
8 | settings_items :terms_of_use, :type => :string, :default => "" | 8 | settings_items :terms_of_use, :type => :string, :default => "" |
9 | settings_items :has_terms_of_use, :type => :boolean, :default => false | 9 | settings_items :has_terms_of_use, :type => :boolean, :default => false |
app/models/input.rb
1 | class Input < ActiveRecord::Base | 1 | class Input < ActiveRecord::Base |
2 | 2 | ||
3 | - attr_accessible :product, :product_category | 3 | + attr_accessible :product, :product_category, :product_category_id, :amount_used, :unit_id, :price_per_unit, :relevant_to_price |
4 | 4 | ||
5 | belongs_to :product | 5 | belongs_to :product |
6 | belongs_to :product_category | 6 | belongs_to :product_category |
app/views/comment/_comment_form.html.erb
@@ -46,14 +46,16 @@ function check_captcha(button, confirm_action) { | @@ -46,14 +46,16 @@ function check_captcha(button, confirm_action) { | ||
46 | } | 46 | } |
47 | </script> | 47 | </script> |
48 | 48 | ||
49 | -<% if @comment && @comment.errors.any? %> | 49 | +<% @comment ||= Comment.new %> |
50 | + | ||
51 | +<% if @comment.errors.any? %> | ||
50 | <%= error_messages_for :comment %> | 52 | <%= error_messages_for :comment %> |
51 | <% end %> | 53 | <% end %> |
52 | 54 | ||
53 | <div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>"> | 55 | <div class="post_comment_box <%= ((defined? show_form) && show_form) ? 'opened' : 'closed' %>"> |
54 | 56 | ||
55 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> | 57 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form') if display_link && @comment.reply_of_id.blank? %> |
56 | -<%= remote_form_for(:comment, comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> | 58 | +<%= remote_form_for(:comment, @comment, :url => {:profile => profile.identifier, :controller => 'comment', :action => (edition_mode ? 'update' : 'create'), :id => (edition_mode ? @comment.id : @page.id)}, :html => { :class => 'comment_form' } ) do |f| %> |
57 | 59 | ||
58 | <%= required_fields_message %> | 60 | <%= required_fields_message %> |
59 | 61 |
app/views/content_viewer/view_page.html.erb
@@ -80,7 +80,7 @@ | @@ -80,7 +80,7 @@ | ||
80 | </h3> | 80 | </h3> |
81 | <% end %> | 81 | <% end %> |
82 | 82 | ||
83 | - <% if @page.accept_comments? && @comments.count > 1 %> | 83 | + <% if @page.accept_comments? && @comments.present? && @comments.count > 1 %> |
84 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %> | 84 | <%= link_to(_('Post a comment'), '#', :class => 'display-comment-form', :id => 'top-post-comment-button', :onclick => "jQuery('#page-comment-form .display-comment-form').first().click();") %> |
85 | 85 | ||
86 | <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %> | 86 | <%= hidden_field_tag("page_url", url_for(:controller=>'content_viewer', :action=>'view_page', :profile=>profile.identifier, :page => @page.explode_path)) %> |
@@ -90,15 +90,15 @@ | @@ -90,15 +90,15 @@ | ||
90 | <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> | 90 | <%= select_tag 'comment_order', options_for_select({_('Oldest first')=>'oldest', _('Newest first')=>'newest'}, @comment_order) %> |
91 | <% end %> | 91 | <% end %> |
92 | </div> | 92 | </div> |
93 | - <% end %> | ||
94 | 93 | ||
95 | - <ul class="article-comments-list"> | ||
96 | - <%= render :partial => 'comment/comment', :collection => @comments %> | ||
97 | - <%= pagination_links @comments, :param_name => 'comment_page' %> | ||
98 | - </ul> | 94 | + <ul class="article-comments-list"> |
95 | + <%= render :partial => 'comment/comment', :collection => @comments %> | ||
96 | + <%= pagination_links @comments, :param_name => 'comment_page' %> | ||
97 | + </ul> | ||
98 | + <% end %> | ||
99 | 99 | ||
100 | <% if @page.accept_comments? %> | 100 | <% if @page.accept_comments? %> |
101 | - <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:comment => Comment.new, :url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div> | 101 | + <div id='page-comment-form' class='page-comment-form'><%= render :partial => 'comment/comment_form', :locals =>{:url => {:controller => :comment, :action => :create}, :display_link => true, :cancel_triggers_hide => true}%></div> |
102 | <% end %> | 102 | <% end %> |
103 | </div><!-- end class="comments" --> | 103 | </div><!-- end class="comments" --> |
104 | 104 |
app/views/invite/_dialog_wait_loading.html.erb
app/views/invite/select_friends.html.erb
@@ -32,9 +32,7 @@ | @@ -32,9 +32,7 @@ | ||
32 | 32 | ||
33 | <br/> | 33 | <br/> |
34 | 34 | ||
35 | - <%= link_to_function(_('Personalize invitation mail'), nil) do |page| | ||
36 | - page['invitation-mail_template'].show | ||
37 | - end %> | 35 | + <%= link_to ('Personalize invitation mail'), nil, :onclick => "jQuery('#invitation-mail_template').show(); return false;" %> |
38 | 36 | ||
39 | <div id='invitation-mail_template' style='display:none'> | 37 | <div id='invitation-mail_template' style='display:none'> |
40 | <%= h _("Now enter an invitation message. You must keep the <url> code in your invitation text. When your friends receive the invitation e-mail, <url> will be replaced by a link that they need to click to activate their account. <user> and <friend> codes will be replaced by your name and friend name, but they are optional.") %> | 38 | <%= h _("Now enter an invitation message. You must keep the <url> code in your invitation text. When your friends receive the invitation e-mail, <url> will be replaced by a link that they need to click to activate their account. <user> and <friend> codes will be replaced by your name and friend name, but they are optional.") %> |
app/views/manage_products/_add_input.html.erb
1 | <div id='request_result_message' style='display: none'></div> | 1 | <div id='request_result_message' style='display: none'></div> |
2 | 2 | ||
3 | -<%= form_for(@input, | 3 | +<%= form_for(:input, |
4 | :url => {:action => 'add_input', :id => @product}, | 4 | :url => {:action => 'add_input', :id => @product}, |
5 | :html => {:method => 'post', :id => 'input-category-form'} | 5 | :html => {:method => 'post', :id => 'input-category-form'} |
6 | ) do |f| %> | 6 | ) do |f| %> |
app/views/manage_products/_categories_for_selection.html.erb
1 | <%= select_for_categories(categories, level) %> | 1 | <%= select_for_categories(categories, level) %> |
2 | 2 | ||
3 | -<% javascript_tag do %> | 3 | +<%= javascript_tag do %> |
4 | jQuery('#categories_container_wrapper').scrollTo('100%', 1000) | 4 | jQuery('#categories_container_wrapper').scrollTo('100%', 1000) |
5 | $('selected_category_id').value = <%= @category && @category.id %> | 5 | $('selected_category_id').value = <%= @category && @category.id %> |
6 | $('hierarchy_navigation').update('<%= escape_javascript(hierarchy_category_navigation(@category, :make_links => true)) %>') | 6 | $('hierarchy_navigation').update('<%= escape_javascript(hierarchy_category_navigation(@category, :make_links => true)) %>') |
app/views/manage_products/_certifiers_for_selection.html.erb
1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> | 1 | <%= select_certifiers(@qualifier) + remove_qualifier_button %> |
2 | -<% javascript_tag do %> | 2 | +<%= javascript_tag do %> |
3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') | 3 | jQuery('#product-qualifiers-list *').removeClass('small-loading') |
4 | <% end %> | 4 | <% end %> |
app/views/manage_products/_display_name.html.erb
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <h2><%= @product.name_with_unit %></h2> | 2 | <h2><%= @product.name_with_unit %></h2> |
3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> | 3 | <%= edit_product_link_to_remote(@product, 'name', _('Edit name and unit'), :title => _('Click here to edit the name of your product and the unit')) %> |
4 | </div> | 4 | </div> |
5 | -<% javascript_tag do %> | 5 | +<%= javascript_tag do %> |
6 | $$('#display-product-category .hierarchy-category')[0].update('<%= | 6 | $$('#display-product-category .hierarchy-category')[0].update('<%= |
7 | escape_javascript(hierarchy_category_navigation( | 7 | escape_javascript(hierarchy_category_navigation( |
8 | @product.product_category, | 8 | @product.product_category, |
app/views/manage_products/_edit_input.html.erb
1 | -<%= form_for(@input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, | 1 | +<%= form_for(:input, :url => {:controller => 'manage_products', :action => 'edit_input', :id => @input}, |
2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> | 2 | :html => {:method => 'post', :id => "edit-input-#{ @input.id }-form"}) do |f| %> |
3 | 3 | ||
4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> | 4 | <%= hidden_field_tag 'input-bar-update-url', @input.product.price_composition_bar_display_url, :class => 'bar-update-url' %> |
app/views/manage_products/_form.html.erb
1 | <%= error_messages_for :product %> <br/> | 1 | <%= error_messages_for :product %> <br/> |
2 | 2 | ||
3 | -<%= form_for :product, @product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> | 3 | +<%= form_for :product, :html => {:multipart => true }, :url => {:action => mode} do |f| %> |
4 | <%= required_fields_message %> | 4 | <%= required_fields_message %> |
5 | 5 | ||
6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> | 6 | <%= display_form_field( _('Name:'), f.text_field(:name) ) %> |
app/views/manage_products/_price_composition_bar.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | var value = <%= @product.price_description_percentage %>; | 2 | var value = <%= @product.price_description_percentage %>; |
3 | var total_cost = <%= @product.total_production_cost %>; | 3 | var total_cost = <%= @product.total_production_cost %>; |
4 | var price = '<%= @product.formatted_value(:price) %>'; | 4 | var price = '<%= @product.formatted_value(:price) %>'; |
app/views/manage_products/new.html.erb
@@ -25,6 +25,6 @@ | @@ -25,6 +25,6 @@ | ||
25 | 25 | ||
26 | <% end %> | 26 | <% end %> |
27 | 27 | ||
28 | -<% javascript_tag do %> | 28 | +<%= javascript_tag do %> |
29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) | 29 | toggleDisabled(<%= @category && @category.accept_products? ? 'true' : 'false' %>, $('save_and_continue')) |
30 | <% end %> | 30 | <% end %> |
app/views/profile/report_abuse.html.erb
1 | -<%= form_for @abuse_report, :url => {:action => 'register_report'}, | 1 | +<%= form_for :abuse_report, :url => {:action => 'register_report'}, |
2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> | 2 | :html => {:onsubmit => "return send_request(this)", :id => 'report-abuse-form'} do |f| %> |
3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> | 3 | <%= labelled_form_field('* ' + _('Report reasons'), f.text_area(:reason, :rows => 6, :cols => 60, :class => 'required')) %> |
4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> | 4 | <%= hidden_field_tag(:content_type, params[:content_type]) %> |
app/views/search/_image.html.erb
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> | 5 | <% if ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'svg'].include? extension %> |
6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> | 6 | <%= link_to '', image.view_url, :class => "search-image-pic", :style => 'background-image: url(%s)'% image.public_filename(:thumb) %> |
7 | <% if image.width && image.height %> | 7 | <% if image.width && image.height %> |
8 | - <% javascript_tag do %> | 8 | + <%= javascript_tag do %> |
9 | image = jQuery('script').last().parent().find('.search-image-pic'); | 9 | image = jQuery('script').last().parent().find('.search-image-pic'); |
10 | des_width = parseInt(image.css('width')); | 10 | des_width = parseInt(image.css('width')); |
11 | des_height = parseInt(image.css('height')); | 11 | des_height = parseInt(image.css('height')); |
app/views/search/search_page.html.erb
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | <div style="clear: both"></div> | 11 | <div style="clear: both"></div> |
12 | 12 | ||
13 | <% if @asset == :product %> | 13 | <% if @asset == :product %> |
14 | - <% javascript_tag do %> | 14 | + <%= javascript_tag do %> |
15 | jQuery('.search-product-price-details').altBeautify(); | 15 | jQuery('.search-product-price-details').altBeautify(); |
16 | <% end %> | 16 | <% end %> |
17 | <% end %> | 17 | <% end %> |
app/views/shared/_dialog_error_messages.html.erb
app/views/shared/_numbers_only_javascript.html.erb
1 | -<% javascript_tag do %> | 1 | +<%= javascript_tag do %> |
2 | jQuery(".numbers-only").keypress(function(event) { | 2 | jQuery(".numbers-only").keypress(function(event) { |
3 | var separator = "<%= environment.currency_separator %>" | 3 | var separator = "<%= environment.currency_separator %>" |
4 | return numbersonly(event, separator) | 4 | return numbersonly(event, separator) |
app/views/shared/_redirect_via_javascript.html.erb
features/edit_profile.feature
@@ -34,11 +34,12 @@ Feature: edit profile | @@ -34,11 +34,12 @@ Feature: edit profile | ||
34 | | identifier | name | owner | | 34 | | identifier | name | owner | |
35 | | o-rappa | O Rappa | joao | | 35 | | o-rappa | O Rappa | joao | |
36 | And feature "enable_organization_url_change" is enabled on environment | 36 | And feature "enable_organization_url_change" is enabled on environment |
37 | - When I go to o-rappa's control panel | ||
38 | - And I follow "Community Info and settings" | ||
39 | - And I should not see "identifier-change-confirmation" | ||
40 | - When I fill in "Address" with "banda-o-rappa" | ||
41 | - And I should see "identifier-change-confirmation" | 37 | + And I go to o-rappa's control panel |
38 | + When I follow "Community Info and settings" | ||
39 | + Then I should not see "WARNING" within "#identifier-change-confirmation" | ||
40 | + And I fill in "Address" with "banda-o-rappa" | ||
41 | + When I leave the "#profile_data_identifier" field | ||
42 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
42 | 43 | ||
43 | @selenium | 44 | @selenium |
44 | Scenario: Confirm url change | 45 | Scenario: Confirm url change |
@@ -46,12 +47,13 @@ Feature: edit profile | @@ -46,12 +47,13 @@ Feature: edit profile | ||
46 | | identifier | name | owner | | 47 | | identifier | name | owner | |
47 | | o-rappa | O Rappa | joao | | 48 | | o-rappa | O Rappa | joao | |
48 | And feature "enable_organization_url_change" is enabled on environment | 49 | And feature "enable_organization_url_change" is enabled on environment |
49 | - When I go to o-rappa's control panel | 50 | + And I go to o-rappa's control panel |
50 | And I follow "Community Info and settings" | 51 | And I follow "Community Info and settings" |
51 | - When I fill in "Address" with "banda-o-rappa" | ||
52 | - Then I should see "identifier-change-confirmation" | 52 | + And I fill in "Address" with "banda-o-rappa" |
53 | + When I leave the "#profile_data_identifier" field | ||
54 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
53 | When I follow "Yes" | 55 | When I follow "Yes" |
54 | - Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem" | 56 | + Then I should not see "WARNING" within "#identifier-change-confirmation" |
55 | 57 | ||
56 | @selenium | 58 | @selenium |
57 | Scenario: Cancel url change | 59 | Scenario: Cancel url change |
@@ -59,9 +61,10 @@ Feature: edit profile | @@ -59,9 +61,10 @@ Feature: edit profile | ||
59 | | identifier | name | owner | | 61 | | identifier | name | owner | |
60 | | o-rappa | O Rappa | joao | | 62 | | o-rappa | O Rappa | joao | |
61 | And feature "enable_organization_url_change" is enabled on environment | 63 | And feature "enable_organization_url_change" is enabled on environment |
62 | - When I go to o-rappa's control panel | 64 | + And I go to o-rappa's control panel |
63 | And I follow "Community Info and settings" | 65 | And I follow "Community Info and settings" |
64 | - When I fill in "Address" with "banda-o-rappa" | ||
65 | - Then I should see "identifier-change-confirmation" | 66 | + And I fill in "Address" with "banda-o-rappa" |
67 | + When I leave the "#profile_data_identifier" field | ||
68 | + Then I should see "WARNING" within "#identifier-change-confirmation" | ||
66 | When I follow "No" | 69 | When I follow "No" |
67 | - Then "identifier-change-confirmation" should not be visible within "profile-identifier-formitem" | 70 | + Then I should not see "WARNING" within "#identifier-change-confirmation" |
features/forum.feature
@@ -14,7 +14,9 @@ Feature: forum | @@ -14,7 +14,9 @@ Feature: forum | ||
14 | Scenario: create a forum | 14 | Scenario: create a forum |
15 | Given I am on joaosilva's control panel | 15 | Given I am on joaosilva's control panel |
16 | And I follow "Manage Content" | 16 | And I follow "Manage Content" |
17 | + And I should see "New content" | ||
17 | And I follow "New content" | 18 | And I follow "New content" |
19 | + And I should see "Forum" | ||
18 | When I follow "Forum" | 20 | When I follow "Forum" |
19 | And I fill in "Title" with "My Forum" | 21 | And I fill in "Title" with "My Forum" |
20 | And I press "Save" | 22 | And I press "Save" |
@@ -97,6 +99,7 @@ Feature: forum | @@ -97,6 +99,7 @@ Feature: forum | ||
97 | And I check "Has terms of use:" | 99 | And I check "Has terms of use:" |
98 | And I press "Save" | 100 | And I press "Save" |
99 | When I follow "New discussion topic" | 101 | When I follow "New discussion topic" |
102 | + And I should see "Text article with visual editor" | ||
100 | And I follow "Text article with visual editor" | 103 | And I follow "Text article with visual editor" |
101 | And I fill in "Title" with "Topic" | 104 | And I fill in "Title" with "Topic" |
102 | And I press "Save" | 105 | And I press "Save" |
@@ -249,6 +252,7 @@ Feature: forum | @@ -249,6 +252,7 @@ Feature: forum | ||
249 | And I am logged in as "mariasilva" | 252 | And I am logged in as "mariasilva" |
250 | And I go to /sample-community/forum | 253 | And I go to /sample-community/forum |
251 | And I follow "New discussion topic" | 254 | And I follow "New discussion topic" |
255 | + And I should see "Text article with visual editor" | ||
252 | And I follow "Text article with visual editor" | 256 | And I follow "Text article with visual editor" |
253 | And I fill in "Title" with "Test" | 257 | And I fill in "Title" with "Test" |
254 | And I press "Save" | 258 | And I press "Save" |
@@ -274,11 +278,13 @@ Feature: forum | @@ -274,11 +278,13 @@ Feature: forum | ||
274 | And I am logged in as "mariasilva" | 278 | And I am logged in as "mariasilva" |
275 | And I go to /sample-community/forum | 279 | And I go to /sample-community/forum |
276 | And I follow "New discussion topic" | 280 | And I follow "New discussion topic" |
281 | + And I should see "Text article with visual editor" | ||
277 | And I follow "Text article with visual editor" | 282 | And I follow "Text article with visual editor" |
278 | And I fill in "Title" with "Test" | 283 | And I fill in "Title" with "Test" |
279 | And I press "Save" | 284 | And I press "Save" |
280 | And I go to /sample-community/forum/test | 285 | And I go to /sample-community/forum/test |
281 | And I follow "New discussion topic" | 286 | And I follow "New discussion topic" |
287 | + And I should see "Text article with visual editor" | ||
282 | And I follow "Text article with visual editor" | 288 | And I follow "Text article with visual editor" |
283 | And I fill in "Title" with "Test inside the topic page" | 289 | And I fill in "Title" with "Test inside the topic page" |
284 | And I press "Save" | 290 | And I press "Save" |
features/manage_fields.feature
@@ -58,6 +58,7 @@ Feature: check all manage fields | @@ -58,6 +58,7 @@ Feature: check all manage fields | ||
58 | Given I follow "Community's fields" | 58 | Given I follow "Community's fields" |
59 | And I check "community_active" | 59 | And I check "community_active" |
60 | And I press "save_community_fields" | 60 | And I press "save_community_fields" |
61 | + And I follow "Community's fields" | ||
61 | And I uncheck "community_active" | 62 | And I uncheck "community_active" |
62 | And I press "save_community_fields" | 63 | And I press "save_community_fields" |
63 | When I go to mycommunity's control panel | 64 | When I go to mycommunity's control panel |
@@ -69,6 +70,7 @@ Feature: check all manage fields | @@ -69,6 +70,7 @@ Feature: check all manage fields | ||
69 | Given I follow "Enterprise's fields" | 70 | Given I follow "Enterprise's fields" |
70 | And I check "enterprise_active" | 71 | And I check "enterprise_active" |
71 | And I press "save_enterprise_fields" | 72 | And I press "save_enterprise_fields" |
73 | + And I follow "Enterprise's fields" | ||
72 | And I uncheck "enterprise_active" | 74 | And I uncheck "enterprise_active" |
73 | And I press "save_enterprise_fields" | 75 | And I press "save_enterprise_fields" |
74 | When I go to paper-street's control panel | 76 | When I go to paper-street's control panel |
features/manage_inputs.feature
@@ -58,6 +58,7 @@ Feature: manage inputs | @@ -58,6 +58,7 @@ Feature: manage inputs | ||
58 | When I go to Rede Moinho's page of product Abbey Road | 58 | When I go to Rede Moinho's page of product Abbey Road |
59 | And I follow "Inputs" | 59 | And I follow "Inputs" |
60 | And I follow "Add the inputs or raw material used by this product" | 60 | And I follow "Add the inputs or raw material used by this product" |
61 | + And I should see "Cancel" within "#categories_selection_actionbar" | ||
61 | And I follow "Cancel" within "#categories_selection_actionbar" | 62 | And I follow "Cancel" within "#categories_selection_actionbar" |
62 | Then I should see "Abbey Road" | 63 | Then I should see "Abbey Road" |
63 | And I should see "Add the inputs or raw material used by this product" | 64 | And I should see "Add the inputs or raw material used by this product" |
@@ -199,6 +200,7 @@ Feature: manage inputs | @@ -199,6 +200,7 @@ Feature: manage inputs | ||
199 | When I go to Rede Moinho's page of product Abbey Road | 200 | When I go to Rede Moinho's page of product Abbey Road |
200 | And I follow "Inputs" | 201 | And I follow "Inputs" |
201 | And I follow "Edit" within ".input-details" | 202 | And I follow "Edit" within ".input-details" |
203 | + And I should see "Cancel" within ".edit_input" | ||
202 | And I follow "Cancel" within ".edit_input" | 204 | And I follow "Cancel" within ".edit_input" |
203 | And I follow "Edit" within ".input-details" | 205 | And I follow "Edit" within ".input-details" |
204 | Then I should see "Amount used" | 206 | Then I should see "Amount used" |
@@ -218,25 +220,6 @@ Feature: manage inputs | @@ -218,25 +220,6 @@ Feature: manage inputs | ||
218 | And I confirm the browser dialog | 220 | And I confirm the browser dialog |
219 | Then I should see "Add the inputs or raw material used by this product" | 221 | Then I should see "Add the inputs or raw material used by this product" |
220 | 222 | ||
221 | - @selenium | ||
222 | - Scenario: Remember in which tab I was | ||
223 | - Given the following products | ||
224 | - | owner | category | name | | ||
225 | - | redemoinho | Music | Depeche Mode | | ||
226 | - | redemoinho | Music | Manu Chao | | ||
227 | - And I am logged in as "joaosilva" | ||
228 | - When I go to Rede Moinho's page of product Depeche Mode | ||
229 | - Then I should see "Add some description to your product" | ||
230 | - And "Add the inputs or raw material used by this product" should not be visible within "#show_product" | ||
231 | - When I follow "Inputs and raw material" | ||
232 | - Then I should see "Add the inputs or raw material used by this product" | ||
233 | - And "Add some description to your product" should not be visible within "#show_product" | ||
234 | - When I go to Rede Moinho's page of product Manu Chao | ||
235 | - Then I should see "Add some description to your product" | ||
236 | - When I go to Rede Moinho's page of product Depeche Mode | ||
237 | - Then I should see "Add the inputs or raw material used by this product" | ||
238 | - And "Add some description to your product" should not be visible within "#show_product" | ||
239 | - | ||
240 | @selenium-fixme | 223 | @selenium-fixme |
241 | Scenario: Order input list | 224 | Scenario: Order input list |
242 | Given the following product_category | 225 | Given the following product_category |
features/step_definitions/invitation_steps.rb
1 | Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| | 1 | Given /^I invite email "(.+)" to join community "(.+)"$/ do |email, community| |
2 | identifier = Community.find_by_name(community).identifier | 2 | identifier = Community.find_by_name(community).identifier |
3 | visit("/myprofile/#{identifier}/profile_members") | 3 | visit("/myprofile/#{identifier}/profile_members") |
4 | - click_link('Invite your friends to join 26 Bsslines') | 4 | + first(:link, "Invite your friends to join #{community}").click |
5 | click_button('Next') | 5 | click_button('Next') |
6 | fill_in('manual_import_addresses', :with => "#{email}") | 6 | fill_in('manual_import_addresses', :with => "#{email}") |
7 | click_link('Personalize invitation mail') | 7 | click_link('Personalize invitation mail') |
features/step_definitions/noosfero_steps.rb
@@ -4,7 +4,8 @@ Given /^the following users?$/ do |table| | @@ -4,7 +4,8 @@ Given /^the following users?$/ do |table| | ||
4 | person_data = item.dup | 4 | person_data = item.dup |
5 | person_data.delete("login") | 5 | person_data.delete("login") |
6 | category = Category.find_by_slug person_data.delete("category") | 6 | category = Category.find_by_slug person_data.delete("category") |
7 | - user = User.create!(:login => item[:login], :password => '123456', :password_confirmation => '123456', :email => item[:login] + "@example.com", :person_data => person_data) | 7 | + email = item[:email] || item[:login] + "@example.com" |
8 | + user = User.create!(:login => item[:login], :password => '123456', :password_confirmation => '123456', :email => email, :person_data => person_data) | ||
8 | user.activate | 9 | user.activate |
9 | p = user.person | 10 | p = user.person |
10 | p.categories << category if category | 11 | p.categories << category if category |
script/install-dependencies/debian-wheezy.sh
@@ -131,4 +131,4 @@ packages=$(grep-dctrl -n -s Build-Depends,Depends,Recommends -S -X noosfero debi | @@ -131,4 +131,4 @@ packages=$(grep-dctrl -n -s Build-Depends,Depends,Recommends -S -X noosfero debi | ||
131 | run sudo apt-get -y install $packages | 131 | run sudo apt-get -y install $packages |
132 | sudo apt-get -y install iceweasel || sudo apt-get -y install firefox | 132 | sudo apt-get -y install iceweasel || sudo apt-get -y install firefox |
133 | 133 | ||
134 | -run bundle --local | 134 | +run bundle install |