brooklynDev / airborne

RSpec driven API testing framework
MIT License
1.13k stars 122 forks source link

Can't login with post '/user/login/', { :email => 'username', :password => 'password' } #73

Open dmotrenko opened 9 years ago

dmotrenko commented 9 years ago

I am trying to login I tried post '/user/login', { :email => 'username', :password => 'password' } Tried post '/user/login', { :email => 'username', :password => 'password' } , { 'Content-Type' => 'application/x-www-form-urlencoded' } and get an error message

I can login with postman using the same credentials I can login with frisby.js frisby.create('login') .post(BASE_URL + 'user/login', { email: email, password: password } ) .expectStatus(200) .expectJSON({ status: 0 })

sethpollack commented 9 years ago

Is Airborne working for you at all? Are you using rails?

dmotrenko commented 9 years ago

Yes, airborne is working for get requests. And I don't use rails.

brooklynDev commented 9 years ago

I tried reproducing this with no luck. Can you post the error message you're getting?

dmotrenko commented 9 years ago

describe 'catalog paid videos' do it 'should validate types' do post '/user/login', { :email => 'email', :password => 'passwrod' }, { 'Content-Type' => 'application/x-www-form-urlencoded' } puts response end end

this is the response {"status":61,"error":[{"description_ru":"поле пустое"},{" description_en":"Field empty"}]} This is custome error message means that I am not logged in.

This is the code I use in frisby.js frisby.create('login') .post(BASE_URL + 'user/login', {email: email, password: password} ) .expectStatus(200) .expectJSON({ status: 0 }) And this works all the time. I get status: 0 as expected and user is logged in.

Also this works for me too resp_login = RestClient.post (BASE_URL + '/user/login/?ctt=json'), :email => USER['email'], :password => USER['password']

And this works too. curl -d "email=user@tvzavr.ru" -d "password=asdasd" http://api.tvzavr.ru/api/3.0/user/login

aditya-freshdesk commented 7 years ago

Is the endpoint right? Or missing base URL

docljn commented 3 years ago

Hello. Code Triage volunteer here. I've just started using airborne and am really enjoying it.

As this issue has been open for several years, and could not be replicated, I would like to propose that it be closed @dmotrenko @brooklynDev