def test_create_project_repository
assert_nil Project.find(4).repository
- post :create_project_repository, :params => {
- :id => 4,
- :vendor => 'Subversion',
- :repository => { :url => 'file:///create/project/repository/subproject2'}
- }
+ post(
+ :create_project_repository,
+ :params => {
+ :id => 4,
+ :vendor => 'Subversion',
+ :repository => {:url => 'file:///create/project/repository/subproject2'}
+ }
+ )
assert_response :created
assert_equal 'application/json', @response.media_type
end
def test_create_already_existing
- post :create_project_repository, :params => {
- :id => 1,
- :vendor => 'Subversion',
- :repository => { :url => 'file:///create/project/repository/subproject2'}
- }
+ post(
+ :create_project_repository,
+ :params => {
+ :id => 1,
+ :vendor => 'Subversion',
+ :repository => {:url => 'file:///create/project/repository/subproject2'}
+ }
+ )
assert_response :conflict
end
def test_create_with_failure
- post :create_project_repository, :params => {
- :id => 4,
- :vendor => 'Subversion',
- :repository => { :url => 'invalid url'}
- }
+ post(
+ :create_project_repository,
+ :params => {
+ :id => 4,
+ :vendor => 'Subversion',
+ :repository => {:url => 'invalid url'}
+ }
+ )
assert_response :unprocessable_entity
end