<commit_before>require 'spec_helper'

describe TestingGroundsController do
  let(:scenario_mock) { ete_scenario_mock }
  let(:user){ FactoryGirl.create(:user) }

  describe "#create" do
    before do
      login_as user
      Api::Scenario.stub(:create).and_return scenario_mock

      post :create
    end

    it 'creates a scenario' do
      expect(SavedScenario.count).to eq(1)
    end

    it "redirects to ETMoses" do
      expect(response).to redirect_to("http://localhost:3002/testing_grounds/import?scenario_id=")
    end
  end
end<commit_msg>Make redirect spec for ETMoses independent of the domain name<commit_after>require 'spec_helper'

describe TestingGroundsController do
  let(:scenario_mock) { ete_scenario_mock }
  let(:user){ FactoryGirl.create(:user) }

  describe "#create" do
    before do
      login_as user
      Api::Scenario.stub(:create).and_return scenario_mock

      post :create
    end

    it 'creates a scenario' do
      expect(SavedScenario.count).to eq(1)
    end

    it "redirects to ETMoses" do
      expect(response.redirect_url).to include("testing_grounds/import?scenario_id=")
    end
  end
end
{'fraction_non_alphanumeric': 0.09306409130816505, 'fraction_numerical': 0.0052677787532923615, 'mean_word_length': 3.6721311475409837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5006688', 'n_tokens_mistral': 377, 'n_tokens_neox': 358, 'n_words': 86}