Skip to content

Commit

Permalink
update rack test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbeales committed Mar 27, 2018
1 parent 9ac8c8c commit bb5ff13
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ group :test do
gem 'database_cleaner', '=1.6.1', require: false # for test database cleaning
gem 'factory_bot', '~> 4.0', require: false # for test data setup
gem 'fuubar', '~> 2.3.1', require: false # rspec formatter
gem 'rack-test', '~> 0.8.3', require: false # for testing rake servers
gem 'rack-test', '~> 1.0.0', require: false # for testing rake servers
gem 'rspec', '~> 3.7.0', require: false # for behavioral driven testing
gem 'rubocop', '~> 0.54.0', require: false # syntax checking
gem 'ruby_audit', '~> 1.2.0', require: false # complements bundler-audit
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ GEM
rack
rack-ssl (1.4.1)
rack
rack-test (0.8.3)
rack-test (1.0.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (12.3.1)
Expand Down Expand Up @@ -283,7 +283,7 @@ DEPENDENCIES
rack-heartbeat (~> 1.1.0)
rack-protection (~> 2.0.1)
rack-ssl (~> 1.4.1)
rack-test (~> 0.8.3)
rack-test (~> 1.0.0)
rake (~> 12.3.1)
ralyxa (~> 1.7.0)
rest-client (~> 2.0.2)
Expand Down
7 changes: 3 additions & 4 deletions spec/models/journal_entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
describe '#respond_to?' do
include_context 'shared attributes'

it { expect(subject.respond_to?(:entry_date)).to be_truthy }
it { expect(subject.respond_to?(:entry)).to be_truthy }
it { expect(subject.respond_to?(:journal)).to be_truthy }

include_examples 'attribute?', :entry_date
include_examples 'attribute?', :entry
include_examples 'attribute?', :journal
include_examples 'common attributes'
end

Expand Down
5 changes: 2 additions & 3 deletions spec/models/journal_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
describe '#respond_to?' do
include_context 'shared attributes'

it { expect(attribute?(:participant)).to be_truthy }
it { expect(attribute?(:journal_entries)).to be_truthy }

include_examples 'attribute?', :journal_entries
include_examples 'attribute?', :participant
include_examples 'name'
include_examples 'common attributes'
end
Expand Down
23 changes: 14 additions & 9 deletions spec/rspec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,12 @@ JournalEntry
 is an instance of JournalEntry
 is valid with valid attributes
#respond_to?
 should be truthy
 should be truthy
 should be truthy
#entry_date
 should be truthy
#entry
 should be truthy
#journal
 should be truthy
common attributes
 should be truthy
#entry_date
Expand All @@ -339,23 +342,25 @@ JournalEntry
unique entry date
 {:timecop=>:freeze}
#to_s
 should eq "2018-03-27 19:45:33 UTC "
 should eq "2018-03-27 20:02:09 UTC "
#created_at today
 is created less than 5 minutes ago

Journal
 is an instance of Journal
 is valid with valid attributes
#respond_to?
 should be truthy
 should be truthy
#journal_entries
 should be truthy
#participant
 should be truthy
#name
 should be truthy
common attributes
 should be truthy
#list_entries
defaults to last 4
 should eq "2018-03-27 19:45:33 UTC 2012-12-12 00:00:00 UTC "
 should eq "2018-03-27 20:02:09 UTC 2012-12-12 00:00:00 UTC "
#read_entry
 should be > 0
#name
Expand Down Expand Up @@ -874,7 +879,7 @@ AlexaService
 should eq " Cannot find instrument blah. Please try again.\n"
 should eq "Below is a list of the ways you might have felt or behaved. Please check the boxes to tell me how often you have felt this way in the past week or so."
#read_all
 should eq "2018-03-27 19:45:32 UTC "
 should eq "2018-03-27 20:02:08 UTC "
 should not be nil

InstrumentLoaderCsv
Expand Down Expand Up @@ -902,6 +907,6 @@ InstrumentLoader
missing instrument
 should raise RuntimeError

Finished in 7.98 seconds (files took 4.57 seconds to load)
Finished in 8.09 seconds (files took 4.39 seconds to load)
462 examples, 0 failures

0 comments on commit bb5ff13

Please sign in to comment.