summaryrefslogtreecommitdiff
path: root/users/test/integration/api/login_test.rb
blob: ba82c8e81302a8eb6c96fae5045047f100c265dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'test_helper'

CONFIG_RU = (Rails.root + 'config.ru').to_s
OUTER_APP = Rack::Builder.parse_file(CONFIG_RU).first

class AccountFlowTest < ActiveSupport::TestCase
  include Rack::Test::Methods
  include Warden::Test::Helpers
  include LeapWebCore::AssertResponses

  def app
    OUTER_APP
  end

  def setup
    @login = "integration_test_user"
  end

  test "require json requests" do
    put "http://api.lvh.me:3000/1/sessions/" + @login,
      :client_auth => "This is not a valid login anyway"
    assert_json_error login: I18n.t(:all_strategies_failed)
  end

end