I don't know if I'm using this correctly, but how am I supposed to run MSL on a port that's already used?
RSpec.describe 'Tournament Settings Overview' do
before :all do
@browser = Watir::Browser.new(:firefox)
@root = 'http://localhost:3082'
@browser.goto @root
@browser.text_field({id: 'user_login'}).set 'user'
@browser.text_field({id: 'user_password'}).set 'password'
@browser.button({name: 'commit'}).click
end
it 'is overridden by msl' do
configurations = {}
configurations['requestPath'] = "#{@root}/api/tournaments/54e4c2bb29de79199e0074de" #<=Adding root is the only way I see to point it at the correct port, otherwise if I start msl-server up on this port, there's a conflict.
configurations['responseText'] = '{"id":"54e4c2bb29de79199e0074de","name":"test 1234","short_name":"test asdf","abbrev":"TSTSDF","start_date":"2015-02-27","end_date":"2015-02-28","sport_id":26,"program_id":null,"program_name":null,"created_at":"2015-02-18T16:50:03Z","description":null,"org_id":7601,"primary_venue_id":null,"timezone":"America/Chicago","dst":null,"time_format":null,"current_season_id":"54e4c2bb29de79199e0074df","microsite_settings":{"standings":true,"schedule":true,"brackets":true,"seed_ranks":true,"auto_publish":true},"season_id":"54e4c2bb29de79199e0074df"}';
configurations['contentType'] = 'application/json'
configurations['eval'] = 'function (req,responseText) { return "[" + responseText + "]"; }'
configurations['statusCode'] = '200'
configurations['delayTime'] = '0'
# Actually make the call to register this information.
setMockRespond('localhost', 8001, configurations.to_json)
@browser.goto("#{@root}/tournaments/54e4c2bb29de79199e0074de/settings");
expect(@browser.element({id: 'tournament-54e4c2bb29de79199e0074de-name'}).value).to eq "test 1234"
end
after :all do
@browser.quit
end
end