json_spec removed
This commit is contained in:
parent
b73d4419ea
commit
4bd3024580
4 changed files with 31 additions and 34 deletions
1
Gemfile
1
Gemfile
|
@ -117,7 +117,6 @@ group :test do
|
||||||
gem 'email_spec'
|
gem 'email_spec'
|
||||||
gem 'resque_spec'
|
gem 'resque_spec'
|
||||||
gem "webmock"
|
gem "webmock"
|
||||||
gem 'json_spec'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
group :production do
|
group :production do
|
||||||
|
|
|
@ -207,9 +207,6 @@ GEM
|
||||||
jquery-rails
|
jquery-rails
|
||||||
railties (>= 3.1.0)
|
railties (>= 3.1.0)
|
||||||
json (1.7.5)
|
json (1.7.5)
|
||||||
json_spec (1.0.3)
|
|
||||||
multi_json (~> 1.0)
|
|
||||||
rspec (~> 2.0)
|
|
||||||
kaminari (0.14.0)
|
kaminari (0.14.0)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
|
@ -409,7 +406,6 @@ DEPENDENCIES
|
||||||
httparty
|
httparty
|
||||||
jquery-rails (= 2.0.2)
|
jquery-rails (= 2.0.2)
|
||||||
jquery-ui-rails (= 0.5.0)
|
jquery-ui-rails (= 0.5.0)
|
||||||
json_spec
|
|
||||||
kaminari
|
kaminari
|
||||||
launchy
|
launchy
|
||||||
letter_opener
|
letter_opener
|
||||||
|
|
|
@ -27,37 +27,40 @@ describe Gitlab::API do
|
||||||
|
|
||||||
describe "POST /projects" do
|
describe "POST /projects" do
|
||||||
it "should create new project without code and path" do
|
it "should create new project without code and path" do
|
||||||
expect {
|
expect { post api("/projects", user), name: 'foo' }.to change {Project.count}.by(1)
|
||||||
name = "foo"
|
|
||||||
post api("/projects", user), {
|
|
||||||
name: name
|
|
||||||
}
|
|
||||||
response.status.should == 201
|
|
||||||
json_response["name"].should == name
|
|
||||||
json_response["code"].should == name
|
|
||||||
json_response["path"].should == name
|
|
||||||
}.should change{Project.count}.by(1)
|
|
||||||
end
|
end
|
||||||
it "should create new project" do
|
|
||||||
attributes = Factory.attributes(:project,
|
it "should not create new project without name" do
|
||||||
name: "foo",
|
expect { post api("/projects", user) }.to_not change {Project.count}
|
||||||
path: "bar",
|
end
|
||||||
code: "bazz",
|
|
||||||
description: "foo project",
|
it "should respond with 201 on success" do
|
||||||
default_branch: "default_branch",
|
post api("/projects", user), name: 'foo'
|
||||||
issues_enabled: false,
|
|
||||||
wall_enabled: false,
|
|
||||||
merge_requests_enabled: false,
|
|
||||||
wiki_enabled: false)
|
|
||||||
post api("/projects", user), attributes
|
|
||||||
response.status.should == 201
|
response.status.should == 201
|
||||||
response.body.should be_json_eql(attributes.to_json).excluding("owner", "private")
|
|
||||||
end
|
end
|
||||||
it "should not create project without name" do
|
|
||||||
expect {
|
it "should repsond with 404 on failure" do
|
||||||
post api("/projects", user)
|
post api("/projects", user)
|
||||||
response.status.should == 404
|
response.status.should == 404
|
||||||
}.should_not change{Project.count}
|
end
|
||||||
|
|
||||||
|
it "should assign attributes to project" do
|
||||||
|
project = Factory.attributes(:project, {
|
||||||
|
path: 'path',
|
||||||
|
code: 'code',
|
||||||
|
description: Faker::Lorem.sentence,
|
||||||
|
default_branch: 'stable',
|
||||||
|
issues_enabled: false,
|
||||||
|
wall_enabled: false,
|
||||||
|
merge_requests_enabled: false,
|
||||||
|
wiki_enabled: false
|
||||||
|
})
|
||||||
|
|
||||||
|
post api("/projects", user), project
|
||||||
|
|
||||||
|
project.each_pair do |k,v|
|
||||||
|
json_response[k.to_s].should == v
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ RSpec.configure do |config|
|
||||||
config.include LoginHelpers, type: :request
|
config.include LoginHelpers, type: :request
|
||||||
config.include GitoliteStub
|
config.include GitoliteStub
|
||||||
config.include FactoryGirl::Syntax::Methods
|
config.include FactoryGirl::Syntax::Methods
|
||||||
config.include JsonSpec::Helpers
|
|
||||||
|
|
||||||
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
||||||
# examples within a transaction, remove the following line or assign false
|
# examples within a transaction, remove the following line or assign false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue