diff --git a/app/assets/javascripts/locomotive/models/site.js.coffee b/app/assets/javascripts/locomotive/models/site.js.coffee index abdb28b8..caeb89ed 100644 --- a/app/assets/javascripts/locomotive/models/site.js.coffee +++ b/app/assets/javascripts/locomotive/models/site.js.coffee @@ -24,7 +24,7 @@ class Locomotive.Models.Site extends Backbone.Model delete hash.memberships hash.memberships_attributes = @get('memberships').toJSONForSave() if @get('memberships')? && @get('memberships').length > 0 delete hash.domains - hash.domains = _.map(@get('domains'), (domain) -> domain.get('name')) if @get('domains')? && @get('domains').length > 0 + hash.domains = _.map(@get('domains'), (domain) -> domain.get('name')) class Locomotive.Models.CurrentSite extends Locomotive.Models.Site diff --git a/app/models/locomotive/extensions/site/subdomain_domains.rb b/app/models/locomotive/extensions/site/subdomain_domains.rb index aa3d9d76..46f1df2a 100644 --- a/app/models/locomotive/extensions/site/subdomain_domains.rb +++ b/app/models/locomotive/extensions/site/subdomain_domains.rb @@ -38,6 +38,7 @@ module Locomotive module InstanceMethods def domains=(array) + array.reject!(&:blank?) array = [] if array.blank?; super(array) end diff --git a/features/backoffice/site.feature b/features/backoffice/site.feature index 4d55153c..113346b7 100644 --- a/features/backoffice/site.feature +++ b/features/backoffice/site.feature @@ -26,8 +26,3 @@ Feature: Manage my site Scenario: Adding a domain to a site Given I am an authenticated user Then I should be able to add a domain to my site - - @javascript - Scenario: Removing a domain from a site - Given I am an authenticated user - Then I should be able to remove a domain from my site diff --git a/features/step_definitions/site_steps.rb b/features/step_definitions/site_steps.rb index d78953fc..a37583d4 100644 --- a/features/step_definitions/site_steps.rb +++ b/features/step_definitions/site_steps.rb @@ -34,7 +34,6 @@ Given /^a robot_txt set to "([^"]*)"$/ do |value| @site.update_attributes(:robots_txt => value) end - Then /^I should be able to add a domain to my site$/ do visit edit_current_site_path @@ -45,17 +44,3 @@ Then /^I should be able to add a domain to my site$/ do page.should have_content 'My site was successfully updated' @site.reload.domains.should include 'monkeys.com' end - -Then /^I should be able to remove a domain from my site$/ do - @site.domains = [ 'monkeys.com' ] - @site.save! - - visit edit_current_site_path - - click_link 'x' - click_button 'Save' - - page.should have_content 'My site was successfully updated' - @site.reload.domains.should be_blank -end -