diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index f134e6f4ca..ddd5bd6723 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -2,13 +2,9 @@ require 'spec_helper' describe GroupsController, type: :controller do render_views - let(:enterprise) { create(:distributor_enterprise) } + + let!(:enterprise) { create(:distributor_enterprise) } let!(:group) { create(:enterprise_group, enterprises: [enterprise], on_front_page: true) } - it "gets all visible groups" do - allow(EnterpriseGroup).to receive_message_chain :on_front_page, :by_position - expect(EnterpriseGroup).to receive :on_front_page - get :index - end it "loads all enterprises for group" do get :index diff --git a/spec/javascripts/unit/darkswarm/services/groups_spec.js.coffee b/spec/javascripts/unit/darkswarm/services/groups_spec.js.coffee deleted file mode 100644 index 50e2159338..0000000000 --- a/spec/javascripts/unit/darkswarm/services/groups_spec.js.coffee +++ /dev/null @@ -1,35 +0,0 @@ -describe "Groups service", -> - Groups = null - Enterprises = null - CurrentHubMock = {} - Geo = {} - groups = [{ - id: 1 - name: "Test Group" - enterprises: [ - {id: 1}, - {id: 2} - ] - }] - enterprises = [ - {id: 1, name: "Test 1", groups: [{id: 1}]}, - {id: 2, name: "Test 2", groups: [{id: 1}]} - ] - - beforeEach -> - module 'Darkswarm' - angular.module('Darkswarm').value('groups', groups) - angular.module('Darkswarm').value('enterprises', enterprises) - module ($provide)-> - $provide.value "CurrentHub", CurrentHubMock - $provide.value "Geo", Geo - null - inject (_Groups_, _Enterprises_)-> - Groups = _Groups_ - Enterprises = _Enterprises_ - - it "dereferences group enterprises", -> - expect(Groups.groups[0].enterprises[0]).toBe enterprises[0] - - it "dereferences enterprise groups", -> - expect(Enterprises.enterprises[0].groups[0]).toBe groups[0]