flapjack 0.8.4 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,15 +32,7 @@ describe 'Flapjack::Gateways::JSONAPI::EntityMethods', :sinatra => true, :logger
32
32
  Flapjack::Gateways::JSONAPI.start
33
33
  end
34
34
 
35
- it "returns a list of checks for an entity" do
36
- expect(entity).to receive(:check_list).and_return([check])
37
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
38
- with(entity_name, :redis => redis).and_return(entity)
39
-
40
- aget "/checks/#{entity_name_esc}"
41
- expect(last_response).to be_ok
42
- expect(last_response.body).to eq([check].to_json)
43
- end
35
+ it "returns a list of checks for an entity"
44
36
 
45
37
  context 'non-bulk API calls' do
46
38
 
@@ -765,99 +757,4 @@ describe 'Flapjack::Gateways::JSONAPI::EntityMethods', :sinatra => true, :logger
765
757
 
766
758
  end
767
759
 
768
- context "tags" do
769
-
770
- it "sets a single tag on an entity and returns current tags" do
771
- expect(entity).to receive(:add_tags).with('web')
772
- expect(entity).to receive(:tags).and_return(['web'])
773
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
774
- with(entity_name, :redis => redis).and_return(entity)
775
-
776
- apost "entities/#{entity_name}/tags", :tag => 'web'
777
- expect(last_response).to be_ok
778
- expect(last_response.body).to eq(['web'].to_json)
779
- end
780
-
781
- it "does not set a single tag on an entity that's not found" do
782
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
783
- with(entity_name, :redis => redis).and_return(nil)
784
-
785
- apost "entities/#{entity_name}/tags", :tag => 'web'
786
- expect(last_response.status).to eq(404)
787
- end
788
-
789
- it "sets multiple tags on an entity and returns current tags" do
790
- expect(entity).to receive(:add_tags).with('web', 'app')
791
- expect(entity).to receive(:tags).and_return(['web', 'app'])
792
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
793
- with(entity_name, :redis => redis).and_return(entity)
794
-
795
- # NB submitted at a lower level as tag[]=web&tag[]=app
796
- apost "entities/#{entity_name}/tags", :tag => ['web', 'app']
797
- expect(last_response).to be_ok
798
- expect(last_response.body).to eq(['web', 'app'].to_json)
799
- end
800
-
801
- it "does not set multiple tags on an entity that's not found" do
802
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
803
- with(entity_name, :redis => redis).and_return(nil)
804
-
805
- apost "entities/#{entity_name}/tags", :tag => ['web', 'app']
806
- expect(last_response.status).to eq(404)
807
- end
808
-
809
- it "removes a single tag from an entity" do
810
- expect(entity).to receive(:delete_tags).with('web')
811
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
812
- with(entity_name, :redis => redis).and_return(entity)
813
-
814
- adelete "entities/#{entity_name}/tags", :tag => 'web'
815
- expect(last_response.status).to eq(204)
816
- end
817
-
818
- it "does not remove a single tag from an entity that's not found" do
819
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
820
- with(entity_name, :redis => redis).and_return(nil)
821
-
822
- adelete "entities/#{entity_name}/tags", :tag => 'web'
823
- expect(last_response.status).to eq(404)
824
- end
825
-
826
- it "removes multiple tags from an entity" do
827
- expect(entity).to receive(:delete_tags).with('web', 'app')
828
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
829
- with(entity_name, :redis => redis).and_return(entity)
830
-
831
- adelete "entities/#{entity_name}/tags", :tag => ['web', 'app']
832
- expect(last_response.status).to eq(204)
833
- end
834
-
835
- it "does not remove multiple tags from an entity that's not found" do
836
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
837
- with(entity_name, :redis => redis).and_return(nil)
838
-
839
- adelete "entities/#{entity_name}/tags", :tag => ['web', 'app']
840
- expect(last_response.status).to eq(404)
841
- end
842
-
843
- it "gets all tags on an entity" do
844
- expect(entity).to receive(:tags).and_return(['web', 'app'])
845
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
846
- with(entity_name, :redis => redis).and_return(entity)
847
-
848
- aget "entities/#{entity_name}/tags"
849
- expect(last_response).to be_ok
850
- expect(last_response.body).to eq(['web', 'app'].to_json)
851
- end
852
-
853
- it "does not get all tags on an entity that's not found" do
854
- expect(Flapjack::Data::Entity).to receive(:find_by_name).
855
- with(entity_name, :redis => redis).and_return(nil)
856
-
857
- aget "entities/#{entity_name}/tags"
858
- expect(last_response.status).to eq(404)
859
- end
860
-
861
- end
862
-
863
760
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-01-31 00:00:00.000000000 Z
13
+ date: 2014-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dante
@@ -442,6 +442,7 @@ files:
442
442
  - lib/flapjack/gateways/web/public/img/flapjack_white_bg_400_353.jpeg
443
443
  - lib/flapjack/gateways/web/public/img/glyphicons-halflings-white.png
444
444
  - lib/flapjack/gateways/web/public/img/glyphicons-halflings.png
445
+ - lib/flapjack/gateways/web/public/img/select2-spinner.gif
445
446
  - lib/flapjack/gateways/web/public/img/select2.png
446
447
  - lib/flapjack/gateways/web/public/img/select2x2.png
447
448
  - lib/flapjack/gateways/web/public/js/backbone-min.js