<commit_before><commit_msg>added tests for responses controller<commit_after>require 'spec_helper'

describe ResponsesController do
  describe "POST receive_message" do
    context "multiple choice poll" do
      before :each do
        @poll = FactoryGirl.new(:poll_multi)
      end  
      
      describe "sms with valid parameters" do
        it "should create a new response" do
          post :receive_message, :params => fixture("sms_multi.json")
          # Response.where
        end
      end
    
      describe "sms with invalid parameters" do
        it "should not create a new response" do
          post :receive_message, :params => fixture("sms_open.json")
        end
      end
    end
    
    context "open-ended poll" do
      before :each do
        @poll = FactoryGirl.new(:poll_open)
      end
      
      describe "sms with valid parameters" do
        it "should create a new response" do
          post :receive_message, :params => fixture("sms_open.json")
        end
      end
    
      describe "sms with invalid parameters" do
        it "should not create a new response" do
          post :receive_message, :params => fixture("sms_multi.json")
        end
      end
      
    end
  end    
end

{'fraction_non_alphanumeric': 0.07073170731707316, 'fraction_numerical': 0.0, 'mean_word_length': 2.092964824120603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '405158', 'n_tokens_mistral': 342, 'n_tokens_neox': 333, 'n_words': 117}