Commit 4bd30245805bc7814fc24686a418a9c883259800

Authored by Alex Denisov
1 parent b73d4419

json_spec removed

Gemfile
... ... @@ -117,7 +117,6 @@ group :test do
117 117 gem 'email_spec'
118 118 gem 'resque_spec'
119 119 gem "webmock"
120   - gem 'json_spec'
121 120 end
122 121  
123 122 group :production do
... ...
Gemfile.lock
... ... @@ -207,9 +207,6 @@ GEM
207 207 jquery-rails
208 208 railties (>= 3.1.0)
209 209 json (1.7.5)
210   - json_spec (1.0.3)
211   - multi_json (~> 1.0)
212   - rspec (~> 2.0)
213 210 kaminari (0.14.0)
214 211 actionpack (>= 3.0.0)
215 212 activesupport (>= 3.0.0)
... ... @@ -409,7 +406,6 @@ DEPENDENCIES
409 406 httparty
410 407 jquery-rails (= 2.0.2)
411 408 jquery-ui-rails (= 0.5.0)
412   - json_spec
413 409 kaminari
414 410 launchy
415 411 letter_opener
... ...
spec/requests/api/projects_spec.rb
... ... @@ -27,37 +27,40 @@ describe Gitlab::API do
27 27  
28 28 describe "POST /projects" do
29 29 it "should create new project without code and path" do
30   - expect {
31   - name = "foo"
32   - post api("/projects", user), {
33   - name: name
34   - }
35   - response.status.should == 201
36   - json_response["name"].should == name
37   - json_response["code"].should == name
38   - json_response["path"].should == name
39   - }.should change{Project.count}.by(1)
40   - end
41   - it "should create new project" do
42   - attributes = Factory.attributes(:project,
43   - name: "foo",
44   - path: "bar",
45   - code: "bazz",
46   - description: "foo project",
47   - default_branch: "default_branch",
48   - issues_enabled: false,
49   - wall_enabled: false,
50   - merge_requests_enabled: false,
51   - wiki_enabled: false)
52   - post api("/projects", user), attributes
  30 + expect { post api("/projects", user), name: 'foo' }.to change {Project.count}.by(1)
  31 + end
  32 +
  33 + it "should not create new project without name" do
  34 + expect { post api("/projects", user) }.to_not change {Project.count}
  35 + end
  36 +
  37 + it "should respond with 201 on success" do
  38 + post api("/projects", user), name: 'foo'
53 39 response.status.should == 201
54   - response.body.should be_json_eql(attributes.to_json).excluding("owner", "private")
55 40 end
56   - it "should not create project without name" do
57   - expect {
58   - post api("/projects", user)
59   - response.status.should == 404
60   - }.should_not change{Project.count}
  41 +
  42 + it "should repsond with 404 on failure" do
  43 + post api("/projects", user)
  44 + response.status.should == 404
  45 + end
  46 +
  47 + it "should assign attributes to project" do
  48 + project = Factory.attributes(:project, {
  49 + path: 'path',
  50 + code: 'code',
  51 + description: Faker::Lorem.sentence,
  52 + default_branch: 'stable',
  53 + issues_enabled: false,
  54 + wall_enabled: false,
  55 + merge_requests_enabled: false,
  56 + wiki_enabled: false
  57 + })
  58 +
  59 + post api("/projects", user), project
  60 +
  61 + project.each_pair do |k,v|
  62 + json_response[k.to_s].should == v
  63 + end
61 64 end
62 65 end
63 66  
... ...
spec/spec_helper.rb
... ... @@ -28,7 +28,6 @@ RSpec.configure do |config|
28 28 config.include LoginHelpers, type: :request
29 29 config.include GitoliteStub
30 30 config.include FactoryGirl::Syntax::Methods
31   - config.include JsonSpec::Helpers
32 31  
33 32 # If you're not using ActiveRecord, or you'd prefer not to run each of your
34 33 # examples within a transaction, remove the following line or assign false
... ...