Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
make proper POST request (see #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
breunigs committed Feb 22, 2015
1 parent d8fefce commit 5141651
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/forwarder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def request(env)
req = Net::HTTP.const_get(m.capitalize).new(path, headers(env))
when 'PUT', 'POST'
req = Net::HTTP.const_get(m.capitalize).new(path, headers(env))
req.body = rackreq.body.to_s
rackreq.body.rewind
req.body = rackreq.body.read
else
raise "method not supported: #{method}"
end
Expand Down
20 changes: 20 additions & 0 deletions spec/features/pizzade_login.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'spec_helper'

describe 'Pizza.de Login', type: :feature do
before do
visit root_path
click_on I18n.t('main.chooser.new_basket.link')
end

it 'reports login failure properly' do
visit root_path + 'profil/login'

within 'form[name=login]' do
fill_in 'user_name', with: 'test'
fill_in 'password', with: 'test'
click_on 'einloggen'
end

expect(page).to have_selector 'td.error'
end
end

0 comments on commit 5141651

Please sign in to comment.