Commit 5281e384424cdf2c2e98843b98a7eecdd6c0fa1e
1 parent
ee6aa672
Exists in
master
and in
29 other branches
ActionItem68: s/Virtual Community/Environment/
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@512 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
33 changed files
with
127 additions
and
127 deletions
Show diff stats
app/controllers/application.rb
@@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base | @@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base | ||
4 | 4 | ||
5 | helper :document | 5 | helper :document |
6 | 6 | ||
7 | - design :holder => 'virtual_community' | 7 | + design :holder => 'environment' |
8 | 8 | ||
9 | # Be sure to include AuthenticationSystem in Application Controller instead | 9 | # Be sure to include AuthenticationSystem in Application Controller instead |
10 | include AuthenticatedSystem | 10 | include AuthenticatedSystem |
@@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base | @@ -12,7 +12,7 @@ class ApplicationController < ActionController::Base | ||
12 | init_gettext 'noosfero' | 12 | init_gettext 'noosfero' |
13 | 13 | ||
14 | before_filter :detect_stuff_by_domain | 14 | before_filter :detect_stuff_by_domain |
15 | - attr_reader :virtual_community | 15 | + attr_reader :environment |
16 | 16 | ||
17 | protected | 17 | protected |
18 | 18 | ||
@@ -20,9 +20,9 @@ class ApplicationController < ActionController::Base | @@ -20,9 +20,9 @@ class ApplicationController < ActionController::Base | ||
20 | def detect_stuff_by_domain | 20 | def detect_stuff_by_domain |
21 | @domain = Domain.find_by_name(request.host) | 21 | @domain = Domain.find_by_name(request.host) |
22 | if @domain.nil? | 22 | if @domain.nil? |
23 | - @virtual_community = VirtualCommunity.default | 23 | + @environment = Environment.default |
24 | else | 24 | else |
25 | - @virtual_community = @domain.virtual_community | 25 | + @environment = @domain.environment |
26 | @profile = @domain.profile | 26 | @profile = @domain.profile |
27 | end | 27 | end |
28 | end | 28 | end |
@@ -38,7 +38,7 @@ class ApplicationController < ActionController::Base | @@ -38,7 +38,7 @@ class ApplicationController < ActionController::Base | ||
38 | @profile | 38 | @profile |
39 | end | 39 | end |
40 | 40 | ||
41 | - def self.acts_as_virtual_community_admin_controller | 41 | + def self.acts_as_environment_admin_controller |
42 | before_filter :load_admin_controller | 42 | before_filter :load_admin_controller |
43 | end | 43 | end |
44 | def load_admin_controller | 44 | def load_admin_controller |
app/controllers/environment_admin/edit_template_controller.rb
1 | class EditTemplateController < EnvironmentAdminController | 1 | class EditTemplateController < EnvironmentAdminController |
2 | 2 | ||
3 | - design_editor :holder => 'virtual_community', :autosave => true, :block_types => :block_types | 3 | + design_editor :holder => 'environment', :autosave => true, :block_types => :block_types |
4 | 4 | ||
5 | def block_types | 5 | def block_types |
6 | { | 6 | { |
app/controllers/environment_admin/features_controller.rb
1 | class FeaturesController < EnvironmentAdminController | 1 | class FeaturesController < EnvironmentAdminController |
2 | 2 | ||
3 | - acts_as_virtual_community_admin_controller | 3 | + acts_as_environment_admin_controller |
4 | 4 | ||
5 | def index | 5 | def index |
6 | - @features = VirtualCommunity.available_features | 6 | + @features = Environment.available_features |
7 | end | 7 | end |
8 | 8 | ||
9 | post_only :update | 9 | post_only :update |
@@ -13,8 +13,8 @@ class FeaturesController < EnvironmentAdminController | @@ -13,8 +13,8 @@ class FeaturesController < EnvironmentAdminController | ||
13 | else | 13 | else |
14 | params[:features].keys | 14 | params[:features].keys |
15 | end | 15 | end |
16 | - @virtual_community.enabled_features = features | ||
17 | - @virtual_community.save! | 16 | + @environment.enabled_features = features |
17 | + @environment.save! | ||
18 | flash[:notice] = _('Features updated successfully.') | 18 | flash[:notice] = _('Features updated successfully.') |
19 | redirect_to :action => 'index' | 19 | redirect_to :action => 'index' |
20 | end | 20 | end |
app/controllers/profile_admin/enterprise_controller.rb
@@ -11,7 +11,7 @@ class EnterpriseController < ProfileAdminController | @@ -11,7 +11,7 @@ class EnterpriseController < ProfileAdminController | ||
11 | else | 11 | else |
12 | redirect_to :action => 'list' | 12 | redirect_to :action => 'list' |
13 | end | 13 | end |
14 | - @vitual_communities = VirtualCommunity.find(:all) | 14 | + @vitual_communities = Environment.find(:all) |
15 | @validation_entities = Organization.find(:all) | 15 | @validation_entities = Organization.find(:all) |
16 | end | 16 | end |
17 | 17 | ||
@@ -28,7 +28,7 @@ class EnterpriseController < ProfileAdminController | @@ -28,7 +28,7 @@ class EnterpriseController < ProfileAdminController | ||
28 | # Make a form to the creation of an eterprise | 28 | # Make a form to the creation of an eterprise |
29 | def register_form | 29 | def register_form |
30 | @enterprise = Enterprise.new() | 30 | @enterprise = Enterprise.new() |
31 | - @vitual_communities = VirtualCommunity.find(:all) | 31 | + @vitual_communities = Environment.find(:all) |
32 | @validation_entities = Organization.find(:all) | 32 | @validation_entities = Organization.find(:all) |
33 | end | 33 | end |
34 | 34 | ||
@@ -42,7 +42,7 @@ class EnterpriseController < ProfileAdminController | @@ -42,7 +42,7 @@ class EnterpriseController < ProfileAdminController | ||
42 | redirect_to :action => 'index' | 42 | redirect_to :action => 'index' |
43 | else | 43 | else |
44 | flash[:notice] = _('Enterprise was not created') | 44 | flash[:notice] = _('Enterprise was not created') |
45 | - @vitual_communities = VirtualCommunity.find(:all) | 45 | + @vitual_communities = Environment.find(:all) |
46 | @validation_entities = Organization.find(:all) | 46 | @validation_entities = Organization.find(:all) |
47 | render :action => 'register_form' | 47 | render :action => 'register_form' |
48 | end | 48 | end |
app/controllers/public/account_controller.rb
@@ -27,12 +27,12 @@ class AccountController < PublicController | @@ -27,12 +27,12 @@ class AccountController < PublicController | ||
27 | def signup | 27 | def signup |
28 | begin | 28 | begin |
29 | @user = User.new(params[:user]) | 29 | @user = User.new(params[:user]) |
30 | - @user.terms_of_use = virtual_community.terms_of_use | ||
31 | - @terms_of_use = virtual_community.terms_of_use | 30 | + @user.terms_of_use = environment.terms_of_use |
31 | + @terms_of_use = environment.terms_of_use | ||
32 | 32 | ||
33 | if request.post? | 33 | if request.post? |
34 | @user.save! | 34 | @user.save! |
35 | - @user.person.virtual_community = virtual_community | 35 | + @user.person.environment = environment |
36 | @user.person.save! | 36 | @user.person.save! |
37 | self.current_user = @user | 37 | self.current_user = @user |
38 | redirect_back_or_default(:controller => 'account', :action => 'index') | 38 | redirect_back_or_default(:controller => 'account', :action => 'index') |
app/controllers/public/home_controller.rb
app/helpers/application_helper.rb
@@ -73,8 +73,8 @@ module ApplicationHelper | @@ -73,8 +73,8 @@ module ApplicationHelper | ||
73 | # TODO: test this helper | 73 | # TODO: test this helper |
74 | # TODO: add an icon? | 74 | # TODO: add an icon? |
75 | # TODO: the command rake test:rcov didn't works because of this method. See what it's the problem | 75 | # TODO: the command rake test:rcov didn't works because of this method. See what it's the problem |
76 | - def virtual_community_identification | ||
77 | - content_tag('div', @virtual_community.name, :id => 'virtual_community_identification') | 76 | + def environment_identification |
77 | + content_tag('div', @environment.name, :id => 'environment_identification') | ||
78 | end | 78 | end |
79 | 79 | ||
80 | def link_to_cms(text, profile = nil, options = {}) | 80 | def link_to_cms(text, profile = nil, options = {}) |
app/models/domain.rb
@@ -40,15 +40,15 @@ class Domain < ActiveRecord::Base | @@ -40,15 +40,15 @@ class Domain < ActiveRecord::Base | ||
40 | name.downcase.sub(/^www\./, '') | 40 | name.downcase.sub(/^www\./, '') |
41 | end | 41 | end |
42 | 42 | ||
43 | - # detects the VirtualCommunity to which this domain belongs, either if it's | 43 | + # detects the Environment to which this domain belongs, either if it's |
44 | # directly owned by one, or through a profile who owns the domain but belongs | 44 | # directly owned by one, or through a profile who owns the domain but belongs |
45 | - # to a VirtualCommunity. | ||
46 | - def virtual_community | 45 | + # to a Environment. |
46 | + def environment | ||
47 | case owner | 47 | case owner |
48 | - when VirtualCommunity | 48 | + when Environment |
49 | owner | 49 | owner |
50 | when Profile | 50 | when Profile |
51 | - owner.virtual_community | 51 | + owner.environment |
52 | end | 52 | end |
53 | end | 53 | end |
54 | 54 | ||
@@ -56,7 +56,7 @@ class Domain < ActiveRecord::Base | @@ -56,7 +56,7 @@ class Domain < ActiveRecord::Base | ||
56 | # not directly associated with a profile. | 56 | # not directly associated with a profile. |
57 | def profile | 57 | def profile |
58 | case owner | 58 | case owner |
59 | - when VirtualCommunity | 59 | + when Environment |
60 | nil | 60 | nil |
61 | when Profile | 61 | when Profile |
62 | owner | 62 | owner |
app/models/profile.rb
1 | # A Profile is the representation and web-presence of an individual or an | 1 | # A Profile is the representation and web-presence of an individual or an |
2 | -# organization. Every Profile is attached to its VirtualCommunity of origin, | ||
3 | -# which by default is the one returned by VirtualCommunity:default. | 2 | +# organization. Every Profile is attached to its Environment of origin, |
3 | +# which by default is the one returned by Environment:default. | ||
4 | class Profile < ActiveRecord::Base | 4 | class Profile < ActiveRecord::Base |
5 | 5 | ||
6 | after_create do |profile| | 6 | after_create do |profile| |
@@ -32,7 +32,7 @@ class Profile < ActiveRecord::Base | @@ -32,7 +32,7 @@ class Profile < ActiveRecord::Base | ||
32 | acts_as_taggable | 32 | acts_as_taggable |
33 | 33 | ||
34 | has_many :domains, :as => :owner | 34 | has_many :domains, :as => :owner |
35 | - belongs_to :virtual_community | 35 | + belongs_to :environment |
36 | 36 | ||
37 | has_many :role_assignments, :as => :resource | 37 | has_many :role_assignments, :as => :resource |
38 | has_many :people, :through => :role_assignments | 38 | has_many :people, :through => :role_assignments |
@@ -56,11 +56,11 @@ class Profile < ActiveRecord::Base | @@ -56,11 +56,11 @@ class Profile < ActiveRecord::Base | ||
56 | validates_uniqueness_of :user_id, :allow_nil =>true | 56 | validates_uniqueness_of :user_id, :allow_nil =>true |
57 | 57 | ||
58 | # creates a new Profile. By default, it is attached to the default | 58 | # creates a new Profile. By default, it is attached to the default |
59 | - # VirtualCommunity (see VirtualCommunity#default), unless you tell it | 59 | + # Environment (see Environment#default), unless you tell it |
60 | # otherwise | 60 | # otherwise |
61 | def initialize(*args) | 61 | def initialize(*args) |
62 | super(*args) | 62 | super(*args) |
63 | - self.virtual_community ||= VirtualCommunity.default | 63 | + self.environment ||= Environment.default |
64 | end | 64 | end |
65 | 65 | ||
66 | # Searches tags by tag or name | 66 | # Searches tags by tag or name |
app/models/virtual_community.rb
1 | -# A VirtualCommunity is like a website to be hosted in the platform. It may | 1 | +# A Environment is like a website to be hosted in the platform. It may |
2 | # contain multiple Profile's and can be identified by several different | 2 | # contain multiple Profile's and can be identified by several different |
3 | # domains. | 3 | # domains. |
4 | -class VirtualCommunity < ActiveRecord::Base | 4 | +class Environment < ActiveRecord::Base |
5 | 5 | ||
6 | - # returns the available features for a VirtualCommunity, in the form of a | 6 | + # returns the available features for a Environment, in the form of a |
7 | # hash, with pairs in the form <tt>'feature_name' => 'Feature name'</tt>. | 7 | # hash, with pairs in the form <tt>'feature_name' => 'Feature name'</tt>. |
8 | def self.available_features | 8 | def self.available_features |
9 | { | 9 | { |
@@ -18,7 +18,7 @@ class VirtualCommunity < ActiveRecord::Base | @@ -18,7 +18,7 @@ class VirtualCommunity < ActiveRecord::Base | ||
18 | 18 | ||
19 | acts_as_design | 19 | acts_as_design |
20 | 20 | ||
21 | - # One VirtualCommunity can be reached by many domains | 21 | + # One Environment can be reached by many domains |
22 | has_many :domains, :as => :owner | 22 | has_many :domains, :as => :owner |
23 | has_many :profiles | 23 | has_many :profiles |
24 | 24 | ||
@@ -26,10 +26,10 @@ class VirtualCommunity < ActiveRecord::Base | @@ -26,10 +26,10 @@ class VirtualCommunity < ActiveRecord::Base | ||
26 | # Attributes | 26 | # Attributes |
27 | # ################################################# | 27 | # ################################################# |
28 | 28 | ||
29 | - # store the VirtualCommunity settings as YAML-serialized Hash. | 29 | + # store the Environment settings as YAML-serialized Hash. |
30 | serialize :settings | 30 | serialize :settings |
31 | 31 | ||
32 | - # returns a Hash containing the VirtualCommunity configuration | 32 | + # returns a Hash containing the Environment configuration |
33 | def settings | 33 | def settings |
34 | self[:settings] ||= {} | 34 | self[:settings] ||= {} |
35 | end | 35 | end |
@@ -74,7 +74,7 @@ class VirtualCommunity < ActiveRecord::Base | @@ -74,7 +74,7 @@ class VirtualCommunity < ActiveRecord::Base | ||
74 | self.settings['terms_of_use'] = value | 74 | self.settings['terms_of_use'] = value |
75 | end | 75 | end |
76 | 76 | ||
77 | - # returns <tt>true</tt> if this VirtualCommunity has terms of use to be | 77 | + # returns <tt>true</tt> if this Environment has terms of use to be |
78 | # accepted by users before registration. | 78 | # accepted by users before registration. |
79 | def has_terms_of_use? | 79 | def has_terms_of_use? |
80 | ! self.settings['terms_of_use'].nil? | 80 | ! self.settings['terms_of_use'].nil? |
@@ -118,13 +118,13 @@ class VirtualCommunity < ActiveRecord::Base | @@ -118,13 +118,13 @@ class VirtualCommunity < ActiveRecord::Base | ||
118 | validates_presence_of :name | 118 | validates_presence_of :name |
119 | 119 | ||
120 | # only one virtual community can be the default one | 120 | # only one virtual community can be the default one |
121 | - validates_uniqueness_of :is_default, :if => (lambda do |virtual_community| virtual_community.is_default? end), :message => _('Only one Virtual Community can be the default one') | 121 | + validates_uniqueness_of :is_default, :if => (lambda do |environment| environment.is_default? end), :message => _('Only one Virtual Community can be the default one') |
122 | 122 | ||
123 | # ################################################# | 123 | # ################################################# |
124 | # Business logic in general | 124 | # Business logic in general |
125 | # ################################################# | 125 | # ################################################# |
126 | 126 | ||
127 | - # the default VirtualCommunity. | 127 | + # the default Environment. |
128 | def self.default | 128 | def self.default |
129 | self.find(:first, :conditions => [ 'is_default = ?', true ] ) | 129 | self.find(:first, :conditions => [ 'is_default = ?', true ] ) |
130 | end | 130 | end |
app/views/features/_features_table.rhtml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <% @features.each do |feature, text| %> | 3 | <% @features.each do |feature, text| %> |
4 | <tr> | 4 | <tr> |
5 | <td><%= text %></td> | 5 | <td><%= text %></td> |
6 | - <td><%= check_box_tag "features[#{feature}]", '1', @virtual_community.enabled?(feature) %></td> | 6 | + <td><%= check_box_tag "features[#{feature}]", '1', @environment.enabled?(feature) %></td> |
7 | </tr> | 7 | </tr> |
8 | <% end %> | 8 | <% end %> |
9 | <tr><td colspan='2'><%= submit_tag _('Save changes') %></td></tr> | 9 | <tr><td colspan='2'><%= submit_tag _('Save changes') %></td></tr> |
app/views/home/index.rhtml
config/environment.rb
@@ -82,17 +82,17 @@ Comatose.configure do |config| | @@ -82,17 +82,17 @@ Comatose.configure do |config| | ||
82 | config.admin_helpers << :application_helper | 82 | config.admin_helpers << :application_helper |
83 | config.admin_helpers << :document_helper | 83 | config.admin_helpers << :document_helper |
84 | end | 84 | end |
85 | -Comatose::AdminController.design :holder => 'virtual_community' | 85 | +Comatose::AdminController.design :holder => 'environment' |
86 | Comatose::AdminController.before_filter do |controller| | 86 | Comatose::AdminController.before_filter do |controller| |
87 | # TODO: copy/paste; extract this into a method (see | 87 | # TODO: copy/paste; extract this into a method (see |
88 | # app/controllers/application.rb) | 88 | # app/controllers/application.rb) |
89 | domain = Domain.find_by_name(controller.request.host) | 89 | domain = Domain.find_by_name(controller.request.host) |
90 | if domain.nil? | 90 | if domain.nil? |
91 | - virtual_community = VirtualCommunity.default | 91 | + environment = Environment.default |
92 | else | 92 | else |
93 | - virtual_community = domain.virtual_community | 93 | + environment = domain.environment |
94 | profile = domain.profile | 94 | profile = domain.profile |
95 | end | 95 | end |
96 | - controller.instance_variable_set('@virtual_community', virtual_community) | 96 | + controller.instance_variable_set('@environment', environment) |
97 | end | 97 | end |
98 | 98 |
db/migrate/002_create_virtual_communities.rb
1 | -class CreateVirtualCommunities < ActiveRecord::Migration | 1 | +class CreateEnvironments < ActiveRecord::Migration |
2 | def self.up | 2 | def self.up |
3 | - create_table :virtual_communities do |t| | 3 | + create_table :environments do |t| |
4 | t.column :name, :string | 4 | t.column :name, :string |
5 | t.column :is_default, :boolean | 5 | t.column :is_default, :boolean |
6 | t.column :settings, :text | 6 | t.column :settings, :text |
7 | t.column :design_data, :text | 7 | t.column :design_data, :text |
8 | end | 8 | end |
9 | - VirtualCommunity.create!(:name => 'Default Virtual Community', :is_default => true) | 9 | + Environment.create!(:name => 'Default Environment', :is_default => true) |
10 | end | 10 | end |
11 | 11 | ||
12 | def self.down | 12 | def self.down |
db/migrate/003_create_profiles.rb
@@ -4,7 +4,7 @@ class CreateProfiles < ActiveRecord::Migration | @@ -4,7 +4,7 @@ class CreateProfiles < ActiveRecord::Migration | ||
4 | t.column :name, :string | 4 | t.column :name, :string |
5 | t.column :type, :string | 5 | t.column :type, :string |
6 | t.column :identifier, :string | 6 | t.column :identifier, :string |
7 | - t.column :virtual_community_id, :integer | 7 | + t.column :environment_id, :integer |
8 | t.column :flexible_template_template, :string, :default => "default" | 8 | t.column :flexible_template_template, :string, :default => "default" |
9 | t.column :flexible_template_theme, :string, :default => "default" | 9 | t.column :flexible_template_theme, :string, :default => "default" |
10 | t.column :flexible_template_icon_theme, :string, :default => "default" | 10 | t.column :flexible_template_icon_theme, :string, :default => "default" |
po/noosfero.pot
@@ -226,35 +226,35 @@ msgstr "" | @@ -226,35 +226,35 @@ msgstr "" | ||
226 | msgid "PersonInfo|Contact information" | 226 | msgid "PersonInfo|Contact information" |
227 | msgstr "" | 227 | msgstr "" |
228 | 228 | ||
229 | -#: app/models/virtual_community.rb:- | 229 | +#: app/models/environment.rb:- |
230 | msgid "virtual community" | 230 | msgid "virtual community" |
231 | msgstr "" | 231 | msgstr "" |
232 | 232 | ||
233 | -#: app/models/virtual_community.rb:- | ||
234 | -msgid "VirtualCommunity|Name" | 233 | +#: app/models/environment.rb:- |
234 | +msgid "Environment|Name" | ||
235 | msgstr "" | 235 | msgstr "" |
236 | 236 | ||
237 | -#: app/models/virtual_community.rb:- | ||
238 | -msgid "VirtualCommunity|Is default" | 237 | +#: app/models/environment.rb:- |
238 | +msgid "Environment|Is default" | ||
239 | msgstr "" | 239 | msgstr "" |
240 | 240 | ||
241 | -#: app/models/virtual_community.rb:- | ||
242 | -msgid "VirtualCommunity|Settings" | 241 | +#: app/models/environment.rb:- |
242 | +msgid "Environment|Settings" | ||
243 | msgstr "" | 243 | msgstr "" |
244 | 244 | ||
245 | -#: app/models/virtual_community.rb:- | ||
246 | -msgid "VirtualCommunity|Design data" | 245 | +#: app/models/environment.rb:- |
246 | +msgid "Environment|Design data" | ||
247 | msgstr "" | 247 | msgstr "" |
248 | 248 | ||
249 | -#: app/models/virtual_community.rb:10 | 249 | +#: app/models/environment.rb:10 |
250 | msgid "Some feature" | 250 | msgid "Some feature" |
251 | msgstr "" | 251 | msgstr "" |
252 | 252 | ||
253 | -#: app/models/virtual_community.rb:11 | 253 | +#: app/models/environment.rb:11 |
254 | msgid "Other feature" | 254 | msgid "Other feature" |
255 | msgstr "" | 255 | msgstr "" |
256 | 256 | ||
257 | -#: app/models/virtual_community.rb:121 | 257 | +#: app/models/environment.rb:121 |
258 | msgid "Only one Virtual Community can be the default one" | 258 | msgid "Only one Virtual Community can be the default one" |
259 | msgstr "" | 259 | msgstr "" |
260 | 260 |
po/pt_BR/noosfero.po
@@ -228,35 +228,35 @@ msgstr "Endereço" | @@ -228,35 +228,35 @@ msgstr "Endereço" | ||
228 | msgid "PersonInfo|Contact information" | 228 | msgid "PersonInfo|Contact information" |
229 | msgstr "Informação de contato" | 229 | msgstr "Informação de contato" |
230 | 230 | ||
231 | -#: app/models/virtual_community.rb:- | 231 | +#: app/models/environment.rb:- |
232 | msgid "virtual community" | 232 | msgid "virtual community" |
233 | msgstr "comunidade virtual" | 233 | msgstr "comunidade virtual" |
234 | 234 | ||
235 | -#: app/models/virtual_community.rb:- | ||
236 | -msgid "VirtualCommunity|Name" | 235 | +#: app/models/environment.rb:- |
236 | +msgid "Environment|Name" | ||
237 | msgstr "Nome" | 237 | msgstr "Nome" |
238 | 238 | ||
239 | -#: app/models/virtual_community.rb:- | ||
240 | -msgid "VirtualCommunity|Is default" | 239 | +#: app/models/environment.rb:- |
240 | +msgid "Environment|Is default" | ||
241 | msgstr "É padrão" | 241 | msgstr "É padrão" |
242 | 242 | ||
243 | -#: app/models/virtual_community.rb:- | ||
244 | -msgid "VirtualCommunity|Settings" | 243 | +#: app/models/environment.rb:- |
244 | +msgid "Environment|Settings" | ||
245 | msgstr "Configurações" | 245 | msgstr "Configurações" |
246 | 246 | ||
247 | -#: app/models/virtual_community.rb:- | ||
248 | -msgid "VirtualCommunity|Design data" | 247 | +#: app/models/environment.rb:- |
248 | +msgid "Environment|Design data" | ||
249 | msgstr "Dados de design" | 249 | msgstr "Dados de design" |
250 | 250 | ||
251 | -#: app/models/virtual_community.rb:10 | 251 | +#: app/models/environment.rb:10 |
252 | msgid "Some feature" | 252 | msgid "Some feature" |
253 | msgstr "Alguma funcionalidade" | 253 | msgstr "Alguma funcionalidade" |
254 | 254 | ||
255 | -#: app/models/virtual_community.rb:11 | 255 | +#: app/models/environment.rb:11 |
256 | msgid "Other feature" | 256 | msgid "Other feature" |
257 | msgstr "Outra funcionalidade" | 257 | msgstr "Outra funcionalidade" |
258 | 258 | ||
259 | -#: app/models/virtual_community.rb:121 | 259 | +#: app/models/environment.rb:121 |
260 | msgid "Only one Virtual Community can be the default one" | 260 | msgid "Only one Virtual Community can be the default one" |
261 | msgstr "Apenas uma comunidade virtual pode ser a padrão" | 261 | msgstr "Apenas uma comunidade virtual pode ser a padrão" |
262 | 262 |
public/artwork/newbar/menu.html
@@ -90,7 +90,7 @@ | @@ -90,7 +90,7 @@ | ||
90 | </div><!-- id="noosfero_bar" --> | 90 | </div><!-- id="noosfero_bar" --> |
91 | 91 | ||
92 | <div id="header"> | 92 | <div id="header"> |
93 | - <div id="virtual_community_identification">Default Virtual Community</div> | 93 | + <div id="environment_identification">Default Virtual Community</div> |
94 | </div> | 94 | </div> |
95 | 95 | ||
96 | <div id='content'> | 96 | <div id='content'> |
public/artwork/tmp/bar.html
@@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
50 | </div> | 50 | </div> |
51 | 51 | ||
52 | <div id="header"> | 52 | <div id="header"> |
53 | - <div id="virtual_community_identification">Default Virtual Community</div> | 53 | + <div id="environment_identification">Default Virtual Community</div> |
54 | <div id="user_links"> | 54 | <div id="user_links"> |
55 | <span id="login_name">Login Name</span><br /> | 55 | <span id="login_name">Login Name</span><br /> |
56 | <a href="#" id="perfil_edit_button">Editar Perfil</a>|<a href="#" id="logout_button">Sair</a> | 56 | <a href="#" id="perfil_edit_button">Editar Perfil</a>|<a href="#" id="logout_button">Sair</a> |
public/artwork/tmp/stylesheets/blue_bar.css
@@ -33,7 +33,7 @@ | @@ -33,7 +33,7 @@ | ||
33 | color: #ffffff; | 33 | color: #ffffff; |
34 | } | 34 | } |
35 | 35 | ||
36 | -#virtual_community_identification { | 36 | +#environment_identification { |
37 | float: left; | 37 | float: left; |
38 | background: url("../images/bg_blue_logo.png") left bottom no-repeat; | 38 | background: url("../images/bg_blue_logo.png") left bottom no-repeat; |
39 | vertical-align: bottom; | 39 | vertical-align: bottom; |
public/stylesheets/common.css
@@ -22,7 +22,7 @@ a:hover img { | @@ -22,7 +22,7 @@ a:hover img { | ||
22 | 22 | ||
23 | /* Bar Blue Default */ | 23 | /* Bar Blue Default */ |
24 | 24 | ||
25 | -#virtual_community_identification { | 25 | +#environment_identification { |
26 | position: absolute !important; | 26 | position: absolute !important; |
27 | background: url("../images/bg_blue_logo.png") 5px no-repeat !important; | 27 | background: url("../images/bg_blue_logo.png") 5px no-repeat !important; |
28 | vertical-align: bottom !important ; | 28 | vertical-align: bottom !important ; |
@@ -32,7 +32,7 @@ line-height: 34px !important ; | @@ -32,7 +32,7 @@ line-height: 34px !important ; | ||
32 | padding-left: 60px !important ; | 32 | padding-left: 60px !important ; |
33 | } | 33 | } |
34 | 34 | ||
35 | -#virtual_community_identification:hover { | 35 | +#environment_identification:hover { |
36 | color: #dfdfdf !important ; | 36 | color: #dfdfdf !important ; |
37 | } | 37 | } |
38 | 38 |
test/fixtures/domains.yml
@@ -2,12 +2,12 @@ | @@ -2,12 +2,12 @@ | ||
2 | one: | 2 | one: |
3 | id: 1 | 3 | id: 1 |
4 | name: colivre.net | 4 | name: colivre.net |
5 | - owner_type: VirtualCommunity | 5 | + owner_type: Environment |
6 | owner_id: 1 | 6 | owner_id: 1 |
7 | two: | 7 | two: |
8 | id: 2 | 8 | id: 2 |
9 | name: anhetegua.net | 9 | name: anhetegua.net |
10 | - owner_type: VirtualCommunity | 10 | + owner_type: Environment |
11 | owner_id: 2 | 11 | owner_id: 2 |
12 | three: | 12 | three: |
13 | id: 3 | 13 | id: 3 |
test/fixtures/profiles.yml
@@ -4,7 +4,7 @@ johndoe: | @@ -4,7 +4,7 @@ johndoe: | ||
4 | name: 'John Doe' | 4 | name: 'John Doe' |
5 | type: 'Person' | 5 | type: 'Person' |
6 | identifier: johndoe | 6 | identifier: johndoe |
7 | - virtual_community_id: 1 | 7 | + environment_id: 1 |
8 | user_id: 1 | 8 | user_id: 1 |
9 | flexible_template_template: 'default' | 9 | flexible_template_template: 'default' |
10 | flexible_template_icon_theme: 'default' | 10 | flexible_template_icon_theme: 'default' |
@@ -14,7 +14,7 @@ joerandomhacker: | @@ -14,7 +14,7 @@ joerandomhacker: | ||
14 | name: 'Joe Random Hacker' | 14 | name: 'Joe Random Hacker' |
15 | type: 'Person' | 15 | type: 'Person' |
16 | identifier: joerandomhacker | 16 | identifier: joerandomhacker |
17 | - virtual_community_id: 1 | 17 | + environment_id: 1 |
18 | user_id: 2 | 18 | user_id: 2 |
19 | flexible_template_template: 'simple' | 19 | flexible_template_template: 'simple' |
20 | flexible_template_icon_theme: 'simple' | 20 | flexible_template_icon_theme: 'simple' |
@@ -24,7 +24,7 @@ john_and_joe: | @@ -24,7 +24,7 @@ john_and_joe: | ||
24 | name: "John and Joe's Production Cooperative" | 24 | name: "John and Joe's Production Cooperative" |
25 | type: 'Person' | 25 | type: 'Person' |
26 | identifier: john_and_joe | 26 | identifier: john_and_joe |
27 | - virtual_community_id: 1 | 27 | + environment_id: 1 |
28 | flexible_template_template: 'simple' | 28 | flexible_template_template: 'simple' |
29 | flexible_template_icon_theme: 'simple' | 29 | flexible_template_icon_theme: 'simple' |
30 | flexible_template_theme: 'simple' | 30 | flexible_template_theme: 'simple' |
@@ -34,7 +34,7 @@ ze: | @@ -34,7 +34,7 @@ ze: | ||
34 | type: 'Person' | 34 | type: 'Person' |
35 | user_id: 3 | 35 | user_id: 3 |
36 | identifier: ze | 36 | identifier: ze |
37 | - virtual_community_id: 1 | 37 | + environment_id: 1 |
38 | flexible_template_template: 'default' | 38 | flexible_template_template: 'default' |
39 | flexible_template_icon_theme: 'default' | 39 | flexible_template_icon_theme: 'default' |
40 | flexible_template_theme: 'default' | 40 | flexible_template_theme: 'default' |
@@ -43,7 +43,7 @@ colivre: | @@ -43,7 +43,7 @@ colivre: | ||
43 | name: "cooptec_livre" | 43 | name: "cooptec_livre" |
44 | type: 'Enterprise' | 44 | type: 'Enterprise' |
45 | identifier: 'colivre' | 45 | identifier: 'colivre' |
46 | - virtual_community_id: 1 | 46 | + environment_id: 1 |
47 | flexible_template_template: 'default' | 47 | flexible_template_template: 'default' |
48 | flexible_template_icon_theme: 'default' | 48 | flexible_template_icon_theme: 'default' |
49 | flexible_template_theme: 'default' | 49 | flexible_template_theme: 'default' |
@@ -52,7 +52,7 @@ empreendimentoB: | @@ -52,7 +52,7 @@ empreendimentoB: | ||
52 | name: "emp B" | 52 | name: "emp B" |
53 | type: 'Enterprise' | 53 | type: 'Enterprise' |
54 | identifier: "empb" | 54 | identifier: "empb" |
55 | - virtual_community_id: 1 | 55 | + environment_id: 1 |
56 | flexible_template_template: 'default' | 56 | flexible_template_template: 'default' |
57 | flexible_template_icon_theme: 'default' | 57 | flexible_template_icon_theme: 'default' |
58 | flexible_template_theme: 'default' | 58 | flexible_template_theme: 'default' |
test/functional/account_controller_test.rb
@@ -70,7 +70,7 @@ class AccountControllerTest < Test::Unit::TestCase | @@ -70,7 +70,7 @@ class AccountControllerTest < Test::Unit::TestCase | ||
70 | 70 | ||
71 | def test_shoud_not_save_without_acceptance_of_terms_of_use_on_signup | 71 | def test_shoud_not_save_without_acceptance_of_terms_of_use_on_signup |
72 | assert_no_difference User, :count do | 72 | assert_no_difference User, :count do |
73 | - VirtualCommunity.default.update_attributes(:terms_of_use => 'some terms ...') | 73 | + Environment.default.update_attributes(:terms_of_use => 'some terms ...') |
74 | create_user | 74 | create_user |
75 | assert_response :success | 75 | assert_response :success |
76 | end | 76 | end |
@@ -78,7 +78,7 @@ class AccountControllerTest < Test::Unit::TestCase | @@ -78,7 +78,7 @@ class AccountControllerTest < Test::Unit::TestCase | ||
78 | 78 | ||
79 | def test_shoud_save_with_acceptance_of_terms_of_use_on_signup | 79 | def test_shoud_save_with_acceptance_of_terms_of_use_on_signup |
80 | assert_difference User, :count do | 80 | assert_difference User, :count do |
81 | - VirtualCommunity.default.update_attributes(:terms_of_use => 'some terms ...') | 81 | + Environment.default.update_attributes(:terms_of_use => 'some terms ...') |
82 | create_user(:terms_accepted => '1') | 82 | create_user(:terms_accepted => '1') |
83 | assert_response :redirect | 83 | assert_response :redirect |
84 | end | 84 | end |
test/functional/application_controller_test.rb
@@ -14,9 +14,9 @@ class ApplicationControllerTest < Test::Unit::TestCase | @@ -14,9 +14,9 @@ class ApplicationControllerTest < Test::Unit::TestCase | ||
14 | @response = ActionController::TestResponse.new | 14 | @response = ActionController::TestResponse.new |
15 | end | 15 | end |
16 | 16 | ||
17 | - def test_exist_virtual_community_variable_to_helper_virtual_community_identification | 17 | + def test_exist_environment_variable_to_helper_environment_identification |
18 | get :index | 18 | get :index |
19 | - assert_not_nil assigns(:virtual_community) | 19 | + assert_not_nil assigns(:environment) |
20 | end | 20 | end |
21 | 21 | ||
22 | def test_get_against_post_only | 22 | def test_get_against_post_only |
test/functional/features_controller_test.rb
@@ -18,7 +18,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | @@ -18,7 +18,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | ||
18 | uses_host 'anhetegua.net' | 18 | uses_host 'anhetegua.net' |
19 | get :index | 19 | get :index |
20 | assert_template 'index' | 20 | assert_template 'index' |
21 | - VirtualCommunity.available_features.each do |feature, text| | 21 | + Environment.available_features.each do |feature, text| |
22 | assert_tag(:tag => 'input', :attributes => { :type => 'checkbox', :name => "features[#{feature}]" }) | 22 | assert_tag(:tag => 'input', :attributes => { :type => 'checkbox', :name => "features[#{feature}]" }) |
23 | end | 23 | end |
24 | end | 24 | end |
@@ -28,7 +28,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | @@ -28,7 +28,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | ||
28 | post :update, :features => { 'feature1' => '1', 'feature2' => '1' } | 28 | post :update, :features => { 'feature1' => '1', 'feature2' => '1' } |
29 | assert_redirected_to :action => 'index' | 29 | assert_redirected_to :action => 'index' |
30 | assert_kind_of String, flash[:notice] | 30 | assert_kind_of String, flash[:notice] |
31 | - v = VirtualCommunity.find(virtual_communities(:anhetegua_net).id) | 31 | + v = Environment.find(virtual_communities(:anhetegua_net).id) |
32 | assert v.enabled?('feature2') | 32 | assert v.enabled?('feature2') |
33 | assert v.enabled?('feature2') | 33 | assert v.enabled?('feature2') |
34 | assert !v.enabled?('feature3') | 34 | assert !v.enabled?('feature3') |
@@ -39,7 +39,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | @@ -39,7 +39,7 @@ class FeaturesControllerTest < Test::Unit::TestCase | ||
39 | post :update # no features | 39 | post :update # no features |
40 | assert_redirected_to :action => 'index' | 40 | assert_redirected_to :action => 'index' |
41 | assert_kind_of String, flash[:notice] | 41 | assert_kind_of String, flash[:notice] |
42 | - v = VirtualCommunity.find(virtual_communities(:anhetegua_net).id) | 42 | + v = Environment.find(virtual_communities(:anhetegua_net).id) |
43 | assert !v.enabled?('feature1') | 43 | assert !v.enabled?('feature1') |
44 | assert !v.enabled?('feature2') | 44 | assert !v.enabled?('feature2') |
45 | assert !v.enabled?('feature3') | 45 | assert !v.enabled?('feature3') |
test/functional/home_controller_test.rb
@@ -14,12 +14,12 @@ class HomeControllerTest < Test::Unit::TestCase | @@ -14,12 +14,12 @@ class HomeControllerTest < Test::Unit::TestCase | ||
14 | @response = ActionController::TestResponse.new | 14 | @response = ActionController::TestResponse.new |
15 | end | 15 | end |
16 | 16 | ||
17 | - def test_detection_of_virtual_community_by_host | 17 | + def test_detection_of_environment_by_host |
18 | uses_host 'www.colivre.net' | 18 | uses_host 'www.colivre.net' |
19 | get :index | 19 | get :index |
20 | assert_template 'index' | 20 | assert_template 'index' |
21 | 21 | ||
22 | - assert_kind_of VirtualCommunity, assigns(:virtual_community) | 22 | + assert_kind_of Environment, assigns(:environment) |
23 | 23 | ||
24 | assert_kind_of Domain, assigns(:domain) | 24 | assert_kind_of Domain, assigns(:domain) |
25 | assert_equal 'colivre.net', assigns(:domain).name | 25 | assert_equal 'colivre.net', assigns(:domain).name |
@@ -32,7 +32,7 @@ class HomeControllerTest < Test::Unit::TestCase | @@ -32,7 +32,7 @@ class HomeControllerTest < Test::Unit::TestCase | ||
32 | get :index | 32 | get :index |
33 | assert_template 'index' | 33 | assert_template 'index' |
34 | 34 | ||
35 | - assert_kind_of VirtualCommunity, assigns(:virtual_community) | 35 | + assert_kind_of Environment, assigns(:environment) |
36 | 36 | ||
37 | assert_kind_of Domain, assigns(:domain) | 37 | assert_kind_of Domain, assigns(:domain) |
38 | assert_equal 'jrh.net', assigns(:domain).name | 38 | assert_equal 'jrh.net', assigns(:domain).name |
@@ -40,14 +40,14 @@ class HomeControllerTest < Test::Unit::TestCase | @@ -40,14 +40,14 @@ class HomeControllerTest < Test::Unit::TestCase | ||
40 | assert_kind_of Profile, assigns(:profile) | 40 | assert_kind_of Profile, assigns(:profile) |
41 | end | 41 | end |
42 | 42 | ||
43 | - def test_unknown_domain_falls_back_to_default_virtual_community | 43 | + def test_unknown_domain_falls_back_to_default_environment |
44 | uses_host 'veryunprobabledomain.com' | 44 | uses_host 'veryunprobabledomain.com' |
45 | 45 | ||
46 | get :index | 46 | get :index |
47 | assert_template 'index' | 47 | assert_template 'index' |
48 | 48 | ||
49 | - assert_kind_of VirtualCommunity, assigns(:virtual_community) | ||
50 | - assert assigns(:virtual_community).is_default? | 49 | + assert_kind_of Environment, assigns(:environment) |
50 | + assert assigns(:environment).is_default? | ||
51 | 51 | ||
52 | end | 52 | end |
53 | 53 |
test/integration/signup_test.rb
@@ -4,7 +4,7 @@ class AccountTest < ActionController::IntegrationTest | @@ -4,7 +4,7 @@ class AccountTest < ActionController::IntegrationTest | ||
4 | fixtures :users, :profiles, :domains, :virtual_communities | 4 | fixtures :users, :profiles, :domains, :virtual_communities |
5 | 5 | ||
6 | def test_should_require_acceptance_of_terms_for_signup | 6 | def test_should_require_acceptance_of_terms_for_signup |
7 | - VirtualCommunity.default.update_attributes(:terms_of_use => 'You agree that from now on your soul belongs to us.') | 7 | + Environment.default.update_attributes(:terms_of_use => 'You agree that from now on your soul belongs to us.') |
8 | 8 | ||
9 | count = User.count | 9 | count = User.count |
10 | 10 |
test/mocks/test/virtual_community.rb
1 | -require File.expand_path(File.dirname(__FILE__) + "/../../../app/models/virtual_community") | 1 | +require File.expand_path(File.dirname(__FILE__) + "/../../../app/models/environment") |
2 | 2 | ||
3 | -class VirtualCommunity < ActiveRecord::Base | 3 | +class Environment < ActiveRecord::Base |
4 | def self.available_features | 4 | def self.available_features |
5 | { | 5 | { |
6 | 'feature1' => 'Enable Feature 1', | 6 | 'feature1' => 'Enable Feature 1', |
test/unit/domain_test.rb
@@ -24,9 +24,9 @@ class DomainTest < Test::Unit::TestCase | @@ -24,9 +24,9 @@ class DomainTest < Test::Unit::TestCase | ||
24 | 24 | ||
25 | def test_owner | 25 | def test_owner |
26 | d = Domain.new(:name => 'example.com') | 26 | d = Domain.new(:name => 'example.com') |
27 | - d.owner = VirtualCommunity.new(:name => 'Example') | 27 | + d.owner = Environment.new(:name => 'Example') |
28 | assert d.save | 28 | assert d.save |
29 | - assert_kind_of VirtualCommunity, d.owner | 29 | + assert_kind_of Environment, d.owner |
30 | end | 30 | end |
31 | 31 | ||
32 | def test_get_domain_name | 32 | def test_get_domain_name |
@@ -64,22 +64,22 @@ class DomainTest < Test::Unit::TestCase | @@ -64,22 +64,22 @@ class DomainTest < Test::Unit::TestCase | ||
64 | assert d.errors.invalid?(:name) | 64 | assert d.errors.invalid?(:name) |
65 | end | 65 | end |
66 | 66 | ||
67 | - def test_virtual_community | ||
68 | - # domain directly linked to VirtualCommunity | 67 | + def test_environment |
68 | + # domain directly linked to Environment | ||
69 | domain = Domain.find_by_name('colivre.net') | 69 | domain = Domain.find_by_name('colivre.net') |
70 | - assert_kind_of VirtualCommunity, domain.owner | ||
71 | - assert_kind_of VirtualCommunity, domain.virtual_community | 70 | + assert_kind_of Environment, domain.owner |
71 | + assert_kind_of Environment, domain.environment | ||
72 | 72 | ||
73 | # domain linked to Profile | 73 | # domain linked to Profile |
74 | domain = Domain.find_by_name('johndoe.net') | 74 | domain = Domain.find_by_name('johndoe.net') |
75 | assert_kind_of Profile, domain.owner | 75 | assert_kind_of Profile, domain.owner |
76 | - assert_kind_of VirtualCommunity, domain.virtual_community | 76 | + assert_kind_of Environment, domain.environment |
77 | end | 77 | end |
78 | 78 | ||
79 | def test_profile | 79 | def test_profile |
80 | # domain linked to profile | 80 | # domain linked to profile |
81 | assert_not_nil Domain.find_by_name('johndoe.net').profile | 81 | assert_not_nil Domain.find_by_name('johndoe.net').profile |
82 | - # domain linked to VirtualCommunity | 82 | + # domain linked to Environment |
83 | assert_nil Domain.find_by_name('colivre.net').profile | 83 | assert_nil Domain.find_by_name('colivre.net').profile |
84 | end | 84 | end |
85 | 85 |
test/unit/enterprise_test.rb
@@ -34,9 +34,9 @@ class EnterpriseTest < Test::Unit::TestCase | @@ -34,9 +34,9 @@ class EnterpriseTest < Test::Unit::TestCase | ||
34 | assert_kind_of Array, p.domains | 34 | assert_kind_of Array, p.domains |
35 | end | 35 | end |
36 | 36 | ||
37 | - def test_belongs_to_virtual_community_and_has_default | 37 | + def test_belongs_to_environment_and_has_default |
38 | p = Enterprise.new | 38 | p = Enterprise.new |
39 | - assert_kind_of VirtualCommunity, p.virtual_community | 39 | + assert_kind_of Environment, p.environment |
40 | end | 40 | end |
41 | 41 | ||
42 | def test_cannot_rename | 42 | def test_cannot_rename |
test/unit/profile_test.rb
@@ -34,9 +34,9 @@ class ProfileTest < Test::Unit::TestCase | @@ -34,9 +34,9 @@ class ProfileTest < Test::Unit::TestCase | ||
34 | assert_kind_of Array, p.domains | 34 | assert_kind_of Array, p.domains |
35 | end | 35 | end |
36 | 36 | ||
37 | - def test_belongs_to_virtual_community_and_has_default | 37 | + def test_belongs_to_environment_and_has_default |
38 | p = Profile.new | 38 | p = Profile.new |
39 | - assert_kind_of VirtualCommunity, p.virtual_community | 39 | + assert_kind_of Environment, p.environment |
40 | end | 40 | end |
41 | 41 | ||
42 | def test_cannot_rename | 42 | def test_cannot_rename |
test/unit/virtual_community_test.rb
1 | require File.dirname(__FILE__) + '/../test_helper' | 1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | 2 | ||
3 | -class VirtualCommunityTest < Test::Unit::TestCase | 3 | +class EnvironmentTest < Test::Unit::TestCase |
4 | fixtures :virtual_communities | 4 | fixtures :virtual_communities |
5 | 5 | ||
6 | def test_exists_default_and_it_is_unique | 6 | def test_exists_default_and_it_is_unique |
7 | - VirtualCommunity.delete_all | ||
8 | - vc = VirtualCommunity.new(:name => 'Test Community') | 7 | + Environment.delete_all |
8 | + vc = Environment.new(:name => 'Test Community') | ||
9 | vc.is_default = true | 9 | vc.is_default = true |
10 | assert vc.save | 10 | assert vc.save |
11 | 11 | ||
12 | - vc2 = VirtualCommunity.new(:name => 'Another Test Community') | 12 | + vc2 = Environment.new(:name => 'Another Test Community') |
13 | vc2.is_default = true | 13 | vc2.is_default = true |
14 | assert !vc2.valid? | 14 | assert !vc2.valid? |
15 | assert vc2.errors.invalid?(:is_default) | 15 | assert vc2.errors.invalid?(:is_default) |
16 | 16 | ||
17 | - assert_equal vc, VirtualCommunity.default | 17 | + assert_equal vc, Environment.default |
18 | end | 18 | end |
19 | 19 | ||
20 | def test_acts_as_configurable | 20 | def test_acts_as_configurable |
21 | - vc = VirtualCommunity.new(:name => 'Testing VirtualCommunity') | 21 | + vc = Environment.new(:name => 'Testing Environment') |
22 | assert_kind_of Hash, vc.settings | 22 | assert_kind_of Hash, vc.settings |
23 | vc.settings[:some_setting] = 1 | 23 | vc.settings[:some_setting] = 1 |
24 | assert vc.save | 24 | assert vc.save |
@@ -26,11 +26,11 @@ class VirtualCommunityTest < Test::Unit::TestCase | @@ -26,11 +26,11 @@ class VirtualCommunityTest < Test::Unit::TestCase | ||
26 | end | 26 | end |
27 | 27 | ||
28 | def test_available_features | 28 | def test_available_features |
29 | - assert_kind_of Hash, VirtualCommunity.available_features | 29 | + assert_kind_of Hash, Environment.available_features |
30 | end | 30 | end |
31 | 31 | ||
32 | def test_mock | 32 | def test_mock |
33 | - assert_equal ['feature1', 'feature2', 'feature3'], VirtualCommunity.available_features.keys.sort | 33 | + assert_equal ['feature1', 'feature2', 'feature3'], Environment.available_features.keys.sort |
34 | end | 34 | end |
35 | 35 | ||
36 | def test_features | 36 | def test_features |
@@ -54,7 +54,7 @@ class VirtualCommunityTest < Test::Unit::TestCase | @@ -54,7 +54,7 @@ class VirtualCommunityTest < Test::Unit::TestCase | ||
54 | end | 54 | end |
55 | 55 | ||
56 | def test_name_is_mandatory | 56 | def test_name_is_mandatory |
57 | - v = VirtualCommunity.new | 57 | + v = Environment.new |
58 | v.valid? | 58 | v.valid? |
59 | assert v.errors.invalid?(:name) | 59 | assert v.errors.invalid?(:name) |
60 | v.name = 'blablabla' | 60 | v.name = 'blablabla' |
@@ -63,23 +63,23 @@ class VirtualCommunityTest < Test::Unit::TestCase | @@ -63,23 +63,23 @@ class VirtualCommunityTest < Test::Unit::TestCase | ||
63 | end | 63 | end |
64 | 64 | ||
65 | def test_terms_of_use | 65 | def test_terms_of_use |
66 | - v = VirtualCommunity.new(:name => 'My test virtual community') | 66 | + v = Environment.new(:name => 'My test virtual community') |
67 | assert_nil v.terms_of_use | 67 | assert_nil v.terms_of_use |
68 | v.terms_of_use = 'To be part of this virtual community, you must accept the following terms: ...' | 68 | v.terms_of_use = 'To be part of this virtual community, you must accept the following terms: ...' |
69 | assert v.save | 69 | assert v.save |
70 | id = v.id | 70 | id = v.id |
71 | - assert_equal 'To be part of this virtual community, you must accept the following terms: ...', VirtualCommunity.find(id).terms_of_use | 71 | + assert_equal 'To be part of this virtual community, you must accept the following terms: ...', Environment.find(id).terms_of_use |
72 | end | 72 | end |
73 | 73 | ||
74 | def test_has_terms_of_use | 74 | def test_has_terms_of_use |
75 | - v = VirtualCommunity.new | 75 | + v = Environment.new |
76 | assert !v.has_terms_of_use? | 76 | assert !v.has_terms_of_use? |
77 | v.terms_of_use = 'some terms of use' | 77 | v.terms_of_use = 'some terms of use' |
78 | assert v.has_terms_of_use? | 78 | assert v.has_terms_of_use? |
79 | end | 79 | end |
80 | 80 | ||
81 | def test_should_profive_flexible_template_stuff | 81 | def test_should_profive_flexible_template_stuff |
82 | - v = VirtualCommunity.new | 82 | + v = Environment.new |
83 | 83 | ||
84 | # template | 84 | # template |
85 | assert_nil v.flexible_template_template | 85 | assert_nil v.flexible_template_template |