Skip to content

Commit

Permalink
Merge branch 'master' into short-indent
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieujobin authored Jun 21, 2024
2 parents 6db90f8 + eef4770 commit b61fb4e
Show file tree
Hide file tree
Showing 16 changed files with 160 additions and 182 deletions.
22 changes: 0 additions & 22 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1011,28 +1011,6 @@ RSpec/EmptyLineAfterHook:
RSpec/ExampleLength:
Max: 85

# Offense count: 159
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
Exclude:
- 'spec/controllers/api/v1/architectures_controller_spec.rb'
- 'spec/controllers/api/v2/nested/resources_controller_spec.rb'
- 'spec/controllers/concerns_controller_spec.rb'
- 'spec/controllers/extended_controller_spec.rb'
- 'spec/controllers/included_param_group_controller_spec.rb'
- 'spec/controllers/users_controller_spec.rb'
- 'spec/lib/apipie/application_spec.rb'
- 'spec/lib/apipie/extractor/writer_spec.rb'
- 'spec/lib/apipie/method_description_spec.rb'
- 'spec/lib/apipie/param_description_spec.rb'
- 'spec/lib/apipie/param_group_spec.rb'
- 'spec/lib/apipie/resource_description_spec.rb'
- 'spec/lib/apipie/validator_spec.rb'
- 'spec/lib/swagger/swagger_dsl_spec.rb'
- 'spec/test_engine/memes_controller_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExcessiveDocstringSpacing:
Expand Down
6 changes: 3 additions & 3 deletions spec/controllers/api/v1/architectures_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe "resource description" do
subject { Apipie.get_resource_description(Api::V1::ArchitecturesController, "1.0") }

it "should be version 1.0" do
it "is version 1.0" do
expect(subject._version).to eq('1.0')

expect(Apipie.resource_descriptions['1.0'].size).to eq(2)
Expand All @@ -14,11 +14,11 @@
context "there is another version" do
let(:v2) { archv2 = Apipie.get_resource_description(Api::V2::ArchitecturesController, "2.0") }

it "should have unique doc url" do
it "has unique doc url" do
expect(subject.doc_url).not_to eq(v2.doc_url)
end

it "should have unique methods" do
it "has unique methods" do
expect(subject._methods.keys).to include(:index)
expect(v2._methods.keys).to include(:index)
expect(subject._methods[:index]).not_to eq(v2._methods[:index])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
describe '.get_resource_id' do
subject { Apipie.get_resource_id(Api::V2::Nested::ResourcesController) }

it "should have resource_id set" do
it "has resource_id set" do
expect(subject).to eq("resource")
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/concerns_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
expect(Apipie["concern_resources#show"]).to be
end

it "should reply to valid request" do
it "replies to valid request" do
get :show, :params => { :id => '5' }, :session => { :user_id => "secret_hash" }
assert_response :success
end

it "should pass if required parameter is missing" do
it "passes if required parameter is missing" do
expect { get :show, :params => { :id => '5' } }.not_to raise_error
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/extended_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

describe ExtendedController do

it 'should include params from both original controller and extending concern' do
it 'includes params from both original controller and extending concern' do
expect(Apipie["extended#create"].params.keys).to eq [:oauth, :user, :admin]
user_param = Apipie["extended#create"].params[:user]
expect(user_param.validator.params_ordered.map(&:name)).to eq [:name, :password, :from_concern]
end

it 'should include updated metadata' do
it 'includes updated metadata' do
expect(Apipie['extended#create'].metadata).to eq metadata: 'data'
end
end
2 changes: 1 addition & 1 deletion spec/controllers/included_param_group_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

let(:dsl_data) { ActionController::Base.send(:_apipie_dsl_data_init) }

it "should not error when there is a param_group that is deeply nested in response description" do
it "does not error when there is a param_group that is deeply nested in response description" do
subject = Apipie.get_resource_description(IncludedParamGroupController, Apipie.configuration.default_version)
expect(subject._methods.keys).to include(:show)
end
Expand Down
Loading

0 comments on commit b61fb4e

Please sign in to comment.