Skip to content

Commit

Permalink
Prepare for 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Strech (Sergey Fedorov) committed Feb 2, 2015
1 parent 71a9448 commit 6b9fc1f
Show file tree
Hide file tree
Showing 31 changed files with 130 additions and 90 deletions.
19 changes: 13 additions & 6 deletions .travis.yml
@@ -1,12 +1,19 @@
language: ruby
sudo: false
gemfile:
- gemfiles/Gemfile32.ci
- gemfiles/Gemfile40.ci
- gemfiles/Gemfile41.ci
- gemfiles/Gemfile42.ci
install: bundle install -j4 --path vendor/bundle
- gemfiles/rails_32.gemfile
- gemfiles/rails_40.gemfile
- gemfiles/rails_41.gemfile
- gemfiles/rails_42.gemfile
rvm:
- 1.9.3
- 2.0.0
- 2.1.1
- 2.1.5
- 2.2.0
matrix:
exclude:
# NOTE : incompatible
- rvm: 2.2.0
gemfile: gemfiles/rails_32.gemfile
install: bundle install -j4 --path vendor/bundle

16 changes: 16 additions & 0 deletions Appraisals
@@ -0,0 +1,16 @@
appraise 'rails-32' do
gem 'rails', '~> 3.2.21'
end

appraise 'rails-40' do
gem 'rails', '~> 4.0.13'
end

appraise 'rails-41' do
gem 'rails', '~> 4.1.9'
end

appraise 'rails-42' do
gem 'rails', '~> 4.2.0'
end

6 changes: 5 additions & 1 deletion Gemfile
Expand Up @@ -17,6 +17,9 @@ group :development do
gem 'highline'
# gem 'coderay', path: '../coderay'

# multiple rails versions support
gem 'appraisal'

# build template static
# run `rake assets:precompile`
# to get bundled application.(js|css)
Expand All @@ -27,5 +30,6 @@ group :development do
gem 'bootstrap-sass', '~> 3.1.1'
gem 'jquery-rails'
gem 'remotipart'
gem "launchy"
gem 'launchy'
end

5 changes: 3 additions & 2 deletions features/atom_persistent_within_the_same_type.feature
Expand Up @@ -51,9 +51,9 @@ Feature: atom persistent within test suite
method: PATCH
path_info: "/api/v2/users/100"
path_params:
id: '100'
controller: api/v2/users
action: update
id: '100'
"""

Scenario: json schema tests response parameters and keep atom unchanged using "users/update"
Expand Down Expand Up @@ -129,8 +129,9 @@ Feature: atom persistent within test suite
method: PATCH
path_info: "/api/v2/users/100"
path_params:
id: '100'
controller: api/v2/users
action: update
id: '100'
"""

3 changes: 2 additions & 1 deletion features/controller_nested_schema_scaffolding.feature
Expand Up @@ -71,10 +71,11 @@ Feature: controller nested schema scaffolding
method: GET
path_info: "/api/v1/users/1/repos.json"
path_params:
user_id: '1'
controller: api/v1/repos
action: index
user_id: '1'
query_params:
limit: 1
"""

3 changes: 2 additions & 1 deletion features/controller_schema_scaffolding.feature
Expand Up @@ -63,8 +63,9 @@ Feature: controller schema scaffolding
method: GET
path_info: "/api/v1/users/1.json"
path_params:
id: '1'
controller: api/v1/users
action: show
id: '1'
"""

3 changes: 2 additions & 1 deletion features/dereferencing_through_inlining.feature
Expand Up @@ -23,9 +23,9 @@ Feature: $ref defererencing through inlining
method: PATCH
path_info: "/api/v3/users/1"
path_params:
id: '1'
controller: api/v3/users
action: update
id: '1'
"""
And a file named "lurker/definitions/user_request_parameters.json" with:
Expand Down Expand Up @@ -100,3 +100,4 @@ Feature: $ref defererencing through inlining
]
}
"""

3 changes: 2 additions & 1 deletion features/html_generation.feature
Expand Up @@ -38,8 +38,8 @@ Feature: html generation
method: POST
path_info: "/api/v1/users.json"
path_params:
action: create
controller: api/v1/users
action: create
"""

When I successfully run `bin/lurker convert`
Expand Down Expand Up @@ -73,3 +73,4 @@ Feature: html generation
And I submit it

Then I should see JSON response with "can't be blank"

5 changes: 3 additions & 2 deletions features/minitest.feature
Expand Up @@ -57,8 +57,8 @@ Feature: minitest
method: DELETE
path_info: "/api/v1/users/1/repos/1.json"
path_params:
action: destroy
controller: api/v1/repos
action: destroy
user_id: '1'
id: '1'
Expand Down Expand Up @@ -100,8 +100,8 @@ Feature: minitest
path_info: "/api/v1/users/1"
method: PATCH
path_params:
action: update
controller: api/v1/users
action: update
id: 1
"""

Expand Down Expand Up @@ -136,3 +136,4 @@ Feature: minitest
"""
1 (runs|tests), 1 assertions, 0 failures, 1 errors, 0 skips
"""

2 changes: 1 addition & 1 deletion features/multidomain_support.feature
Expand Up @@ -47,8 +47,8 @@ Feature: mutidomain support
method: DELETE
path_info: "/api/v1/users/1.json"
path_params:
action: destroy
controller: api/v1/users
action: destroy
id: 1
"""

Expand Down
5 changes: 3 additions & 2 deletions features/multitype_request_support.feature
Expand Up @@ -52,9 +52,9 @@ Feature: multitype request support
method: PATCH
path_info: "/api/v2/users/1"
path_params:
id: '1'
controller: api/v2/users
action: update
id: '1'
"""

Scenario: json schema tests response parameters and update request parameters using "users/update"
Expand Down Expand Up @@ -130,8 +130,9 @@ Feature: multitype request support
method: PATCH
path_info: "/api/v2/users/1"
path_params:
id: '1'
controller: api/v2/users
action: update
id: '1'
"""

5 changes: 3 additions & 2 deletions features/partials.feature
Expand Up @@ -61,8 +61,8 @@ Feature: partials
method: POST
path_info: "/api/v1/users/1/repos.json"
path_params:
action: create
controller: api/v1/repos
action: create
user_id: '1'
"""

Expand All @@ -77,7 +77,7 @@ Feature: partials
it "creates a new repo" do
expect {
post "api/v1/users/#{user.id}/repos.json", repo: { name: 'new-gem' }
post "/api/v1/users/#{user.id}/repos.json", repo: { name: 'new-gem' }
expect(response).to be_success
expect(JSON.parse(response.body)['user']).to eq JSON.parse(user.to_json)
}.to change { Repo.count } .by(1)
Expand All @@ -97,3 +97,4 @@ Feature: partials
create index.html
create api/v1/users/__user_id/repos-POST.html
"""

6 changes: 3 additions & 3 deletions features/request_nested_schema_scaffolding.feature
Expand Up @@ -8,15 +8,14 @@ Feature: request nested schema scaffolding
require "spec_helper"
describe Api::V1::ReposController, :lurker do
let!(:user) do
User.where(name: 'razum2um').first_or_create!.tap do |u|
u.repos.first_or_create!(name: 'lurker')
end
end
it "shows a user's repo" do
get "api/v1/users/#{user.id}/repos/#{user.repos.first.id}.json"
get "/api/v1/users/#{user.id}/repos/#{user.repos.first.id}.json"
expect(response).to be_success
end
end
Expand Down Expand Up @@ -62,9 +61,10 @@ Feature: request nested schema scaffolding
method: GET
path_info: "/api/v1/users/1/repos/1.json"
path_params:
action: show
controller: api/v1/repos
action: show
user_id: '1'
id: '1'
"""

5 changes: 3 additions & 2 deletions features/request_schema_scaffolding.feature
Expand Up @@ -19,7 +19,7 @@ Feature: request schema scaffolding
end
it "lists all the users" do
get "api/v1/users.json?limit=1"
get "/api/v1/users.json?limit=1"
expect(response).to be_success
expect(JSON.parse(response.body).size).to eq 1
end
Expand Down Expand Up @@ -72,9 +72,10 @@ Feature: request schema scaffolding
method: GET
path_info: "/api/v1/users.json"
path_params:
action: index
controller: api/v1/users
action: index
query_params:
limit: '1'
"""

4 changes: 2 additions & 2 deletions features/schema_suffixes.feature
Expand Up @@ -49,8 +49,8 @@ Feature: schema suffixes
path_info: "/api/v1/users/razum2um/repos/lurker.json"
method: PATCH
path_params:
action: update
controller: api/v1/repos
action: update
user_id: razum2um
id: lurker
"""
Expand Down Expand Up @@ -120,8 +120,8 @@ Feature: schema suffixes
method: PATCH
suffix: 'failed'
path_params:
action: update
controller: api/v1/repos
action: update
user_id: razum2um
id: lurker
"""
Expand Down
5 changes: 3 additions & 2 deletions features/schema_updating_within_test_suite.feature
Expand Up @@ -54,9 +54,9 @@ Feature: schema updating within test suite
method: PATCH
path_info: "/api/v2/users/1"
path_params:
id: '1'
controller: api/v2/users
action: update
id: '1'
"""

Scenario: json schema tests response parameters and request parameters and show errors from both using "users/update"
Expand Down Expand Up @@ -166,8 +166,9 @@ Feature: schema updating within test suite
method: PATCH
path_info: "/api/v2/users/1"
path_params:
id: '1'
controller: api/v2/users
action: update
id: '1'
"""

32 changes: 2 additions & 30 deletions features/test_endpoint.feature
Expand Up @@ -48,8 +48,8 @@ Feature: test endpoint
path_info: "/api/v1/users/1"
method: PATCH
path_params:
action: update
controller: api/v1/users
action: update
id: 1
"""

Expand All @@ -75,35 +75,6 @@ Feature: test endpoint
When I run `bin/rspec spec/controllers/api/v1/users_controller_spec.rb`
Then the example should pass

Scenario: json schema tests request parameters and tell what fails using "users/update"
Given a file named "spec/controllers/api/v1/users_controller_spec.rb" with:
"""ruby
require "spec_helper"
describe Api::V1::UsersController, :lurker do
render_views
let(:user) do
User.where(name: 'razum2um').first_or_create!
end
it "updates a user" do
patch :update, id: user.id, user: { name: 1 }, format: 'json'
expect(response).to be_success
end
end
"""

When I run `bin/rspec spec/controllers/api/v1/users_controller_spec.rb`
Then the output should contain failures:
"""
Lurker::ValidationError:
Response
The property '#/name' of type Fixnum did not match the following type: string
1 example, 1 failure
"""

Scenario: json schema tests response parameters and tell what fails using "users/update"
Given a file named "spec/controllers/api/v1/users_controller_blank_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -132,3 +103,4 @@ Feature: test endpoint
1 example, 1 failure
"""

6 changes: 0 additions & 6 deletions gemfiles/Gemfile32.ci

This file was deleted.

6 changes: 0 additions & 6 deletions gemfiles/Gemfile40.ci

This file was deleted.

6 changes: 0 additions & 6 deletions gemfiles/Gemfile41.ci

This file was deleted.

6 changes: 0 additions & 6 deletions gemfiles/Gemfile42.ci

This file was deleted.

7 changes: 7 additions & 0 deletions gemfiles/rails_32.gemfile
@@ -0,0 +1,7 @@
source "https://rubygems.org"

# Specify your gem's dependencies in lurker.gemspec
gemspec path: "../"

gem "rails", "~> 3.2.21"

0 comments on commit 6b9fc1f

Please sign in to comment.