diff --git a/spec/models/agents/telegram_agent_spec.rb b/spec/models/agents/telegram_agent_spec.rb index 9613197fda..ad046ae9d1 100644 --- a/spec/models/agents/telegram_agent_spec.rb +++ b/spec/models/agents/telegram_agent_spec.rb @@ -175,7 +175,6 @@ def stub_methods describe '#complete_chat_id' do it 'returns a list of all recents chats, groups and channels' do stub_request(:post, "https://api.telegram.org/botxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates"). - with(headers: {}). to_return(status: 200, body: '{"ok":true,"result":[{"update_id":252965475,"message":{"message_id":15,"from":{"id":97201077,"is_bot":false,"first_name":"Dominik","last_name":"Sander","language_code":"en-US"},"chat":{"id":97201077,"first_name":"Dominik","last_name":"Sander","type":"private"},"date":1506774710,"text":"test"}},{"update_id":252965476,"channel_post":{"message_id":4,"chat":{"id":-1001144599139,"title":"Much channel","type":"channel"},"date":1506782283,"text":"channel"}},{"update_id":252965477,"message":{"message_id":18,"from":{"id":97201077,"is_bot":false,"first_name":"Dominik","last_name":"Sander","language_code":"en-US"},"chat":{"id":-217850512,"title":"Just a test","type":"group","all_members_are_administrators":true},"date":1506782504,"left_chat_participant":{"id":136508315,"is_bot":true,"first_name":"Huginn","username":"HuginnNotificationBot"},"left_chat_member":{"id":136508315,"is_bot":true,"first_name":"Huginn","username":"HuginnNotificationBot"}}}]}', headers: {'Content-Type' => 'application/json'}) expect(@checker.complete_chat_id).to eq([{:id=>97201077, :text=>"Dominik Sander"}, @@ -187,7 +186,6 @@ def stub_methods describe '#validate_auth_token' do it 'returns true if the token is valid' do stub_request(:post, "https://api.telegram.org/botxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getMe"). - with(headers: {}). to_return(status: 200, body: '{"ok": true}', headers: {'Content-Type' => 'application/json'}) expect(@checker.validate_auth_token).to be_truthy @@ -195,7 +193,6 @@ def stub_methods it 'returns false if the token is invalid' do stub_request(:post, "https://api.telegram.org/botxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getMe"). - with(headers: {}). to_return(status: 200, body: "{}") expect(@checker.validate_auth_token).to be_falsy