diff --git a/app/models/article.rb b/app/models/article.rb index c2edf39..5294712 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -2,7 +2,7 @@ require 'hpricot' class Article < ActiveRecord::Base - 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 + 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 acts_as_having_image diff --git a/app/models/block.rb b/app/models/block.rb index 5a8d757..f5dba88 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -1,6 +1,6 @@ class Block < ActiveRecord::Base - attr_accessible :title, :display, :limit, :box_id + attr_accessible :title, :display, :limit, :box_id, :posts_per_page, :visualization_format, :language # to be able to generate HTML include ActionView::Helpers::UrlHelper diff --git a/app/models/event.rb b/app/models/event.rb index cf65067..f471afa 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -3,7 +3,7 @@ require 'builder' class Event < Article - attr_accessible :start_date, :end_date, :link + attr_accessible :start_date, :end_date, :link, :address def self.type_name _('Event') diff --git a/app/models/organization.rb b/app/models/organization.rb index 6e116e6..87d94ab 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,7 +1,7 @@ # Represents any organization of the system class Organization < Profile - attr_accessible :moderated_articles, :foundation_year, :contact_person, :acronym, :legal_form, :economic_activity, :management_information + attr_accessible :moderated_articles, :foundation_year, :contact_person, :acronym, :legal_form, :economic_activity, :management_information, :cnpj, :display_name SEARCH_FILTERS += %w[ more_popular diff --git a/app/models/product.rb b/app/models/product.rb index 5a69734..5f25eab 100644 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -11,7 +11,7 @@ class Product < ActiveRecord::Base SEARCH_DISPLAYS = %w[map full] - attr_accessible :name, :product_category, :highlighted, :price, :enterprise, :image_builder, :description + attr_accessible :name, :product_category, :highlighted, :price, :enterprise, :image_builder, :description, :available, :qualifiers def self.default_search_display 'full' diff --git a/app/models/profile.rb b/app/models/profile.rb index 4baaccf..297407d 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -3,7 +3,7 @@ # which by default is the one returned by Environment:default. class Profile < ActiveRecord::Base - attr_accessible :name, :identifier, :public_profile, :nickname, :custom_footer, :custom_header, :address, :zip_code, :contact_phone, :image_builder, :description, :closed, :template_id, :environment, :lat, :lng, :is_template, :fields_privacy, :preferred_domain_id, :category_ids, :country, :city, :state, :national_region_code + attr_accessible :name, :identifier, :public_profile, :nickname, :custom_footer, :custom_header, :address, :zip_code, :contact_phone, :image_builder, :description, :closed, :template_id, :environment, :lat, :lng, :is_template, :fields_privacy, :preferred_domain_id, :category_ids, :country, :city, :state, :national_region_code, :email, :contact_email # use for internationalizable human type names in search facets # reimplement on subclasses diff --git a/config/routes.rb b/config/routes.rb index 2686f28..d61e761 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -61,7 +61,7 @@ Noosfero::Application.routes.draw do match 'profile/:profile/events', :controller => 'events', :action => 'events', :profile => /#{Noosfero.identifier_format}/ # catalog - match 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format}/ + match 'catalog/:profile', :controller => 'catalog', :action => 'index', :profile => /#{Noosfero.identifier_format}/, :as => :catalog # invite match 'profile/:profile/invite/friends', :controller => 'invite', :action => 'select_address_book', :profile => /#{Noosfero.identifier_format}/ diff --git a/features/step_definitions/noosfero_steps.rb b/features/step_definitions/noosfero_steps.rb index 6203023..defd2b0 100644 --- a/features/step_definitions/noosfero_steps.rb +++ b/features/step_definitions/noosfero_steps.rb @@ -14,7 +14,7 @@ Given /^the following users?$/ do |table| end Given /^"(.+)" is (invisible|visible)$/ do |user, visibility| - User.find_by_login(user).person.update_attributes(:visible => (visibility == 'visible')) + User.find_by_login(user).person.update_attributes({:visible => (visibility == 'visible')}, :without_protection => true) end Given /^"(.+)" is (online|offline|busy) in chat$/ do |user, status| @@ -30,7 +30,7 @@ Given /^the following (community|communities|enterprises?|organizations?)$/ do | category = row.delete("category") img_name = row.delete("img") city = row.delete("region") - organization = klass.create!(row) + organization = klass.create!(row, :without_protection => true) if owner organization.add_admin(Profile[owner]) end @@ -215,7 +215,7 @@ Given /^the following inputs?$/ do |table| unit = Unit.find_by_singular(data.delete("unit")) solidary = data.delete("solidary") input = Input.create!(data.merge(:product => product, :product_category => category, :unit => unit, - :is_from_solidarity_economy => solidary)) + :is_from_solidarity_economy => solidary), :without_protection => true) input.update_attributes!(:position => data['position']) end end @@ -247,13 +247,13 @@ Given /^the following (product_categories|product_category|category|categories|r parent = Category.find_by_slug(parent.to_slug) row.merge!({:parent_id => parent.id}) end - category = klass.create!({:environment_id => Environment.default.id}.merge(row)) + category = klass.create!({:environment => Environment.default}.merge(row)) end end Given /^the following qualifiers$/ do |table| table.hashes.each do |row| - Qualifier.create!(row.merge(:environment_id => 1)) + Qualifier.create!(row.merge(:environment_id => 1), :without_protection => true) end end @@ -264,7 +264,7 @@ Given /^the following certifiers$/ do |table| if qualifiers_list row["qualifiers"] = qualifiers_list.split(', ').map{|i| Qualifier.find_by_name(i)} end - Certifier.create!(row.merge(:environment_id => 1)) + Certifier.create!(row.merge(:environment_id => 1), :without_protection => true) end end @@ -285,18 +285,18 @@ Given /^the following price details?$/ do |table| end Given /^I am logged in as "(.+)"$/ do |username| - Given %{I go to logout page} - And %{I go to login page} - And %{I fill in "main_user_login" with "#{username}"} - And %{I fill in "user_password" with "123456"} - When %{I press "Log in"} + step %{I go to logout page} + step %{I go to login page} + step %{I fill in "main_user_login" with "#{username}"} + step %{I fill in "user_password" with "123456"} + step %{I press "Log in"} # FIXME: # deveria apenas verificar que esta no myprofile do usuario # nao conseguir fazer funcionar sem essa reduntancia no capybara # acho que e algum problema com o http_referer # olhar account_controller#store_location - And %{I go to #{username}'s control panel} - Then %{I should be on #{username}'s control panel} + step %{I go to #{username}'s control panel} + step %{I should be on #{username}'s control panel} end Given /^"([^"]*)" is environment admin$/ do |person| @@ -512,7 +512,7 @@ end Given /^the following units?$/ do |table| table.hashes.each do |row| - Unit.create!(row.merge(:environment_id => 1)) + Unit.create!(row.merge(:environment_id => 1), :without_protection => true) end end @@ -640,9 +640,9 @@ Given /^the following tags$/ do |table| end When /^I search ([^\"]*) for "([^\"]*)"$/ do |asset, query| - When %{I go to the search #{asset} page} - And %{I fill in "search-input" with "#{query}"} - And %{I press "Search"} + step %{I go to the search #{asset} page} + step %{I fill in "search-input" with "#{query}"} + step %{I press "Search"} end Then /^I should see ([^\"]*)'s product image$/ do |product_name| diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb index 271358a..70108e3 100644 --- a/features/step_definitions/web_steps.rb +++ b/features/step_definitions/web_steps.rb @@ -11,7 +11,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "pat module WithinHelpers def with_scope(locator) - locator ? within(locator) { yield } : yield + locator ? first(locator) { yield } : yield end end World(WithinHelpers) @@ -26,13 +26,13 @@ end When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| with_scope(selector) do - click_button(button) + first(:button, button).click end end When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| with_scope(selector) do - click_link(link) + first(:link, link).click end end @@ -62,7 +62,7 @@ end When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| with_scope(selector) do fields.rows_hash.each do |name, value| - When %{I fill in "#{name}" with "#{value}"} + step %{I fill in "#{name}" with "#{value}"} end end end -- libgit2 0.21.2