Skip to content
This repository has been archived by the owner on May 1, 2018. It is now read-only.

HW 3 Babych Svitlana #19

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

SvitlanaLana
Copy link

@SvitlanaLana SvitlanaLana commented Nov 6, 2016

HW 2: add router and tests

@SvitlanaLana SvitlanaLana changed the title HW 1 Babych Svitlana HW 2 Babych Svitlana Nov 13, 2016
@SvitlanaLana SvitlanaLana changed the title HW 2 Babych Svitlana HW 3 Babych Svitlana Nov 21, 2016
break
end
end
lamda = ->(env) { [404, {}, ['Page not found']] } unless lamda
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use lambda ||= ->(env) { [404, {}, ['Page not found']] }

let(:env) { { 'REQUEST_METHOD' => 'GET'} }

it 'url have argument' do
env['REQUEST_PATH'] = '/test'
Copy link
Owner

@denysxftr denysxftr Nov 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can move this to let


it 'matches request' do
env['REQUEST_PATH'] = '/test'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this

expect(env['PARAMS'][:field]).to eq '12'
end

it '404' do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here you can have a separate context for 404 case

@denysxftr
Copy link
Owner

nice

@denysxftr
Copy link
Owner

@tilast hw4

@tilast
Copy link

tilast commented Dec 10, 2016

hw4 looks good

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants