Skip to content

Commit

Permalink
Test notes model
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefreitag committed Jul 3, 2020
1 parent 2653aa5 commit ace9068
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ todos/log/*.log
todos/tmp/
.gems/
coverage/
.byebug_history
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ gemspec
# your gem to rubygems.org.

# To use a debugger
# gem 'byebug', group: [:development, :test]
gem 'byebug', group: [:development, :test]
gem 'awesome_print', group: [:development, :test]
gem 'shoulda-matchers', group: :test
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ GEM
tzinfo (~> 1.1)
arel (9.0.0)
ast (2.4.1)
awesome_print (1.8.0)
bcrypt (3.1.13)
builder (3.2.4)
byebug (11.1.3)
committee (3.3.0)
json_schema (~> 0.14, >= 0.14.3)
openapi_parser (>= 0.6.1)
Expand Down Expand Up @@ -212,6 +214,8 @@ GEM
activerecord (~> 5.0)
schema_plus_columns
valuable
shoulda-matchers (4.3.0)
activesupport (>= 4.2.0)
simplecov (0.17.1)
docile (~> 1.1)
json (>= 1.8, < 3)
Expand Down Expand Up @@ -241,6 +245,8 @@ PLATFORMS
ruby

DEPENDENCIES
awesome_print
byebug
croods!
gem-release
pg
Expand All @@ -249,6 +255,7 @@ DEPENDENCIES
rspec_junit_formatter (~> 0.4.1)
rubocop (= 0.80.1)
rubocop-rspec (= 1.38.1)
shoulda-matchers
simplecov (~> 0.17.0)
timecop (= 0.9.1)

Expand Down
6 changes: 6 additions & 0 deletions spec/support/shoulda_matchers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
4 changes: 2 additions & 2 deletions todos/app/resources/notes/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module Model
extend ActiveSupport::Concern

included do
belongs_to :assignments, optional: true
belongs_to :assignment, optional: true

schema_validations auto_create: false
#schema_validations auto_create: false
end
end
end
2 changes: 2 additions & 0 deletions todos/app/resources/notes/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
module Notes
class Resource < ApplicationResource
filter_by :list

extend_model { include Notes::Model }
end
end

0 comments on commit ace9068

Please sign in to comment.