spec/tutter_spec.rb in tutter-0.0.2 vs spec/tutter_spec.rb in tutter-0.0.3

- old
+ new

@@ -1,32 +1,32 @@ require 'spec_helper' require 'json' describe 'tutter' do - it 'should complain about missing project in settings' do + it 'expect complain about missing project in settings' do post '/', params=JSON.generate({'repository' => {'full_name' => '404'}}), {'HTTP_X_GITHUB_EVENT' => 'fake'} - last_response.body.should match /Project does not exist in tutter.conf/ - last_response.status.should == 404 + expect { last_response.body match /Project does not exist in tutter.conf/ } + expect { last_response.status == 404 } end - it 'should complain about POST data not being JSON' do + it 'expect complain about POST data not being JSON' do post '/', params={'broken' => 'data'}, {'HTTP_X_GITHUB_EVENT' => 'fake'} - last_response.body.should match /POST data is not JSON/ - last_response.status.should == 400 + expect { last_response.body match /POST data is not JSON/ } + expect { last_response.status == 400 } end - it 'should return documentation URL' do + it 'expect return documentation URL' do get '/' - last_response.body.should match /Source code and documentation/ + expect { last_response.body match /Source code and documentation/ } end end describe 'tutter Hello action' do - it 'should complain about invalid credentials' do + it 'expect complain about invalid credentials' do data = IO.read('spec/fixtures/new_issue.json') post '/', params=data, {'HTTP_X_GITHUB_EVENT' => 'fake'} - last_response.body.should match /Authorization to JHaals\/testing failed, please verify your access token/ - last_response.status.should == 401 + expect { last_response.body match /Authorization to JHaals\/testing failed, please verify your access token/ } + expect { last_response.status == 401 } end end \ No newline at end of file