Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--format documentation
--format doc
--color
--require spec_helper
--order rand
2 changes: 1 addition & 1 deletion lib/readymade/background_bang_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

module Readymade
class BackgroundBangJob < ::ActiveJob::Base
queue_as { self.arguments[0].fetch(:queue_as, :default) }
queue_as { arguments[0].fetch(:queue_as, :default) }

def perform(**args)
args.delete(:class_name).to_s.constantize.send(:call!, **args)
Expand Down
2 changes: 2 additions & 0 deletions lib/readymade/controller/serialization.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/concern'

module Readymade
Expand Down
2 changes: 2 additions & 0 deletions lib/readymade/model/api_attachable.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/concern'

module Readymade
Expand Down
2 changes: 2 additions & 0 deletions lib/readymade/model/filterable.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'active_support/concern'

module Readymade
Expand Down
2 changes: 1 addition & 1 deletion spec/readymade/action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
string: 'some string',
integer: rand(1..10),
array: Array,
array: Array
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/readymade/background_bang_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def call!
{
string: 'some string',
integer: rand(1..10),
array: Array,
array: Array
}
end

Expand Down
2 changes: 1 addition & 1 deletion spec/readymade/background_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Dummy < Readymade::Action
{
string: 'some string',
integer: rand(1..10),
array: Array,
array: Array
}
end

Expand Down
12 changes: 6 additions & 6 deletions spec/readymade/form_options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

RSpec.describe Readymade::Form::FormOptions do
class TestForm < Readymade::Form
PERMITTED_ATTRIBUTES = %i[attr1 attr2 attr3]
REQUIRED_ATTRIBUTES = %i[attr1 attr3]
PERMITTED_ATTRIBUTES = %i[attr1 attr2 attr3].freeze
REQUIRED_ATTRIBUTES = %i[attr1 attr3].freeze
end

class TestFormWithFormOptions < Readymade::Form
PERMITTED_ATTRIBUTES = %i[attr1 attr2 attr3]
REQUIRED_ATTRIBUTES = %i[attr1 attr3]
PERMITTED_ATTRIBUTES = %i[attr1 attr2 attr3].freeze
REQUIRED_ATTRIBUTES = %i[attr1 attr3].freeze

def form_options
{
attr1: [1,2,3],
attr1: [1, 2, 3],
passed_argument: args[:passed_argument]
}
end
end

let(:args) do
{
attr1: [1,2,3],
attr1: [1, 2, 3],
attr2: 'attr two',
attr3: 'attr three',
passed_argument: 'passed_argument'
Expand Down
2 changes: 2 additions & 0 deletions spec/support/api_attachable.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

def to_api_file(file)
{ base64: Base64.encode64(file.read), filename: file.original_filename }
end