Explorar o código

Add failing test for effect key

Christopher Mullins %!s(int64=6) %!d(string=hai) anos
pai
achega
ca0729bdda
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      test/remote/spec/state_spec.rb

+ 8 - 0
test/remote/spec/state_spec.rb

@@ -374,6 +374,14 @@ RSpec.describe 'State' do
       # Should retain previous brightness
       expect(result['level']).to eq(50)
     end
+
+    it 'should support the mode and effect fields' do
+      state = @client.patch_state({status: 'ON', mode: 0}, @id_params)
+      expect(state['effect']).to eq("0")
+
+      state = @client.patch_state({effect: 1}, @id_params)
+      expect(state['effect']).to eq("1")
+    end
   end
 
   context 'increment/decrement commands' do