mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-05 20:54:27 +08:00
1. fixes failing unit and integration tests
2. fixes gem dependencies issues 3. fixes failing migrations 4. updates depricated factory_girl => factory_bot and fixes related issues Signed-off-by: zmagod <zmago_devetak@yahoo.com>
This commit is contained in:
parent
f8a3fca2db
commit
88d7429041
40 changed files with 187 additions and 173 deletions
6
Gemfile
6
Gemfile
|
@ -5,7 +5,7 @@ ruby '2.4.1'
|
||||||
gem 'rails', '5.1.1'
|
gem 'rails', '5.1.1'
|
||||||
gem 'webpacker', '~> 2.0'
|
gem 'webpacker', '~> 2.0'
|
||||||
gem 'figaro'
|
gem 'figaro'
|
||||||
gem 'pg'
|
gem 'pg', '~> 0.18'
|
||||||
gem 'devise', '~> 4.3.0'
|
gem 'devise', '~> 4.3.0'
|
||||||
gem 'devise_invitable'
|
gem 'devise_invitable'
|
||||||
gem 'simple_token_authentication', '~> 1.15.1' # Token authentication for Devise
|
gem 'simple_token_authentication', '~> 1.15.1' # Token authentication for Devise
|
||||||
|
@ -53,7 +53,7 @@ gem 'commit_param_routing' # Enables different submit actions in the same form t
|
||||||
gem 'kaminari'
|
gem 'kaminari'
|
||||||
gem 'i18n-js', '~> 3.0' # Localization in javascript files
|
gem 'i18n-js', '~> 3.0' # Localization in javascript files
|
||||||
gem 'roo', '~> 2.7.1' # Spreadsheet parser
|
gem 'roo', '~> 2.7.1' # Spreadsheet parser
|
||||||
gem 'wicked_pdf', '~> 1.0.6'
|
gem 'wicked_pdf', '~> 1.1.0'
|
||||||
gem 'silencer' # Silence certain Rails logs
|
gem 'silencer' # Silence certain Rails logs
|
||||||
gem 'wkhtmltopdf-heroku'
|
gem 'wkhtmltopdf-heroku'
|
||||||
gem 'remotipart', '~> 1.2' # Async file uploads
|
gem 'remotipart', '~> 1.2' # Async file uploads
|
||||||
|
@ -98,7 +98,7 @@ group :development, :test do
|
||||||
gem 'pry'
|
gem 'pry'
|
||||||
gem 'pry-byebug'
|
gem 'pry-byebug'
|
||||||
gem 'pry-rails'
|
gem 'pry-rails'
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_bot_rails'
|
||||||
gem 'rails-controller-testing'
|
gem 'rails-controller-testing'
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
gem 'better_errors'
|
gem 'better_errors'
|
||||||
|
|
180
Gemfile.lock
180
Gemfile.lock
|
@ -1,9 +1,9 @@
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/biosistemika/canaid
|
remote: https://github.com/biosistemika/canaid
|
||||||
revision: 96366be967aa9770ea23f606ded803233913557e
|
revision: f2000c19b75e66ea929a44cb0575262b7f5fc13e
|
||||||
branch: master
|
branch: master
|
||||||
specs:
|
specs:
|
||||||
canaid (1.0.0)
|
canaid (1.0.1)
|
||||||
devise (>= 3.4.1)
|
devise (>= 3.4.1)
|
||||||
rails (>= 4)
|
rails (>= 4)
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ GEM
|
||||||
activemodel (= 5.1.1)
|
activemodel (= 5.1.1)
|
||||||
activesupport (= 5.1.1)
|
activesupport (= 5.1.1)
|
||||||
arel (~> 8.0)
|
arel (~> 8.0)
|
||||||
activerecord-import (0.20.2)
|
activerecord-import (0.22.0)
|
||||||
activerecord (>= 3.2)
|
activerecord (>= 3.2)
|
||||||
activesupport (5.1.1)
|
activesupport (5.1.1)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
|
@ -98,18 +98,18 @@ GEM
|
||||||
ast (2.3.0)
|
ast (2.3.0)
|
||||||
auto_strip_attributes (2.2.0)
|
auto_strip_attributes (2.2.0)
|
||||||
activerecord (>= 3.0)
|
activerecord (>= 3.0)
|
||||||
autoprefixer-rails (7.1.6)
|
autoprefixer-rails (7.2.5)
|
||||||
execjs
|
execjs
|
||||||
autosize-rails (1.18.17)
|
autosize-rails (1.18.17)
|
||||||
rails (>= 3.1)
|
rails (>= 3.1)
|
||||||
awesome_print (1.8.0)
|
awesome_print (1.8.0)
|
||||||
aws-sdk (2.10.69)
|
aws-sdk (2.10.123)
|
||||||
aws-sdk-resources (= 2.10.69)
|
aws-sdk-resources (= 2.10.123)
|
||||||
aws-sdk-core (2.10.69)
|
aws-sdk-core (2.10.123)
|
||||||
aws-sigv4 (~> 1.0)
|
aws-sigv4 (~> 1.0)
|
||||||
jmespath (~> 1.0)
|
jmespath (~> 1.0)
|
||||||
aws-sdk-resources (2.10.69)
|
aws-sdk-resources (2.10.123)
|
||||||
aws-sdk-core (= 2.10.69)
|
aws-sdk-core (= 2.10.123)
|
||||||
aws-sdk-v1 (1.67.0)
|
aws-sdk-v1 (1.67.0)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
|
@ -118,34 +118,34 @@ GEM
|
||||||
babel-transpiler (0.7.0)
|
babel-transpiler (0.7.0)
|
||||||
babel-source (>= 4.0, < 6)
|
babel-source (>= 4.0, < 6)
|
||||||
execjs (~> 2.0)
|
execjs (~> 2.0)
|
||||||
backports (3.10.3)
|
backports (3.11.0)
|
||||||
base62 (1.0.0)
|
base62 (1.0.0)
|
||||||
bcrypt (3.1.11)
|
bcrypt (3.1.11)
|
||||||
better_errors (2.4.0)
|
better_errors (2.4.0)
|
||||||
coderay (>= 1.0.0)
|
coderay (>= 1.0.0)
|
||||||
erubi (>= 1.0.0)
|
erubi (>= 1.0.0)
|
||||||
rack (>= 0.9.0)
|
rack (>= 0.9.0)
|
||||||
binding_of_caller (0.7.3)
|
binding_of_caller (0.8.0)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bootstrap-sass (3.3.7)
|
bootstrap-sass (3.3.7)
|
||||||
autoprefixer-rails (>= 5.2.1)
|
autoprefixer-rails (>= 5.2.1)
|
||||||
sass (>= 3.3.4)
|
sass (>= 3.3.4)
|
||||||
bootstrap-select-rails (1.12.1)
|
bootstrap-select-rails (1.6.3)
|
||||||
bootstrap3-datetimepicker-rails (4.15.35)
|
bootstrap3-datetimepicker-rails (4.15.35)
|
||||||
momentjs-rails (>= 2.8.1)
|
momentjs-rails (>= 2.8.1)
|
||||||
bootstrap_form (2.7.0)
|
bootstrap_form (2.7.0)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
bullet (5.6.1)
|
bullet (5.7.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
uniform_notifier (~> 1.10.0)
|
uniform_notifier (~> 1.11.0)
|
||||||
byebug (9.1.0)
|
byebug (9.1.0)
|
||||||
capybara (2.16.1)
|
capybara (2.17.0)
|
||||||
addressable
|
addressable
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (>= 2.0, < 4.0)
|
||||||
capybara-email (2.5.0)
|
capybara-email (2.5.0)
|
||||||
capybara (~> 2.4)
|
capybara (~> 2.4)
|
||||||
mail
|
mail
|
||||||
|
@ -163,40 +163,37 @@ GEM
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
commit_param_routing (0.0.1)
|
commit_param_routing (0.0.1)
|
||||||
concurrent-ruby (1.0.5)
|
concurrent-ruby (1.0.5)
|
||||||
crass (1.0.2)
|
crass (1.0.3)
|
||||||
creek (1.1.2)
|
cucumber (3.1.0)
|
||||||
nokogiri (~> 1.6.0)
|
|
||||||
rubyzip (>= 1.0.0)
|
|
||||||
cucumber (3.0.1)
|
|
||||||
builder (>= 2.1.2)
|
builder (>= 2.1.2)
|
||||||
cucumber-core (~> 3.0.0)
|
cucumber-core (~> 3.1.0)
|
||||||
cucumber-expressions (~> 4.0.3)
|
cucumber-expressions (~> 5.0.4)
|
||||||
cucumber-wire (~> 0.0.1)
|
cucumber-wire (~> 0.0.1)
|
||||||
diff-lcs (~> 1.3)
|
diff-lcs (~> 1.3)
|
||||||
gherkin (~> 4.0)
|
gherkin (~> 5.0)
|
||||||
multi_json (>= 1.7.5, < 2.0)
|
multi_json (>= 1.7.5, < 2.0)
|
||||||
multi_test (>= 0.1.2)
|
multi_test (>= 0.1.2)
|
||||||
cucumber-core (3.0.0)
|
cucumber-core (3.1.0)
|
||||||
backports (>= 3.8.0)
|
backports (>= 3.8.0)
|
||||||
cucumber-tag_expressions (>= 1.0.1)
|
cucumber-tag_expressions (~> 1.1.0)
|
||||||
gherkin (>= 4.1.3)
|
gherkin (>= 5.0.0)
|
||||||
cucumber-expressions (4.0.4)
|
cucumber-expressions (5.0.13)
|
||||||
cucumber-rails (1.5.0)
|
cucumber-rails (1.5.0)
|
||||||
capybara (>= 1.1.2, < 3)
|
capybara (>= 1.1.2, < 3)
|
||||||
cucumber (>= 1.3.8, < 4)
|
cucumber (>= 1.3.8, < 4)
|
||||||
mime-types (>= 1.17, < 4)
|
mime-types (>= 1.17, < 4)
|
||||||
nokogiri (~> 1.5)
|
nokogiri (~> 1.5)
|
||||||
railties (>= 4, < 5.2)
|
railties (>= 4, < 5.2)
|
||||||
cucumber-tag_expressions (1.0.1)
|
cucumber-tag_expressions (1.1.1)
|
||||||
cucumber-wire (0.0.1)
|
cucumber-wire (0.0.1)
|
||||||
database_cleaner (1.6.1)
|
database_cleaner (1.6.2)
|
||||||
debug_inspector (0.0.3)
|
debug_inspector (0.0.3)
|
||||||
deface (1.2.0)
|
deface (1.3.0)
|
||||||
nokogiri (~> 1.6)
|
nokogiri (~> 1.6)
|
||||||
polyglot
|
polyglot
|
||||||
rails (>= 4.1)
|
rails (>= 4.1)
|
||||||
rainbow (>= 2.1.0)
|
rainbow (>= 2.1.0)
|
||||||
delayed_job (4.1.3)
|
delayed_job (4.1.4)
|
||||||
activesupport (>= 3.0, < 5.2)
|
activesupport (>= 3.0, < 5.2)
|
||||||
delayed_job_active_record (4.1.2)
|
delayed_job_active_record (4.1.2)
|
||||||
activerecord (>= 3.0, < 5.2)
|
activerecord (>= 3.0, < 5.2)
|
||||||
|
@ -214,25 +211,26 @@ GEM
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
erubi (1.7.0)
|
erubi (1.7.0)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.8.1)
|
factory_bot (4.8.2)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
factory_girl_rails (4.8.0)
|
factory_bot_rails (4.8.2)
|
||||||
factory_girl (~> 4.8.0)
|
factory_bot (~> 4.8.2)
|
||||||
railties (>= 3.0.0)
|
railties (>= 3.0.0)
|
||||||
faker (1.8.4)
|
faker (1.8.7)
|
||||||
i18n (~> 0.5)
|
i18n (>= 0.7)
|
||||||
ffi (1.9.18)
|
ffi (1.9.18)
|
||||||
figaro (1.1.1)
|
figaro (1.1.1)
|
||||||
thor (~> 0.14)
|
thor (~> 0.14)
|
||||||
font-awesome-rails (4.7.0.2)
|
font-awesome-rails (4.7.0.3)
|
||||||
railties (>= 3.2, < 5.2)
|
railties (>= 3.2, < 5.2)
|
||||||
gherkin (4.1.3)
|
gherkin (5.0.0)
|
||||||
globalid (0.4.0)
|
globalid (0.4.1)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
hammerjs-rails (2.0.8)
|
hammerjs-rails (2.0.8)
|
||||||
i18n (0.9.0)
|
hashie (3.5.7)
|
||||||
|
i18n (0.9.3)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
i18n-js (3.0.1)
|
i18n-js (3.0.3)
|
||||||
i18n (~> 0.6, >= 0.6.6)
|
i18n (~> 0.6, >= 0.6.6)
|
||||||
introjs-rails (1.0.0)
|
introjs-rails (1.0.0)
|
||||||
sass-rails (>= 3.2)
|
sass-rails (>= 3.2)
|
||||||
|
@ -257,6 +255,7 @@ GEM
|
||||||
addressable (>= 2.4)
|
addressable (>= 2.4)
|
||||||
json_matchers (0.7.2)
|
json_matchers (0.7.2)
|
||||||
json-schema (~> 2.7)
|
json-schema (~> 2.7)
|
||||||
|
jwt (2.1.0)
|
||||||
kaminari (1.1.1)
|
kaminari (1.1.1)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
kaminari-actionview (= 1.1.1)
|
kaminari-actionview (= 1.1.1)
|
||||||
|
@ -287,23 +286,26 @@ GEM
|
||||||
mime-types (1.25.1)
|
mime-types (1.25.1)
|
||||||
mimemagic (0.3.2)
|
mimemagic (0.3.2)
|
||||||
mini_mime (1.0.0)
|
mini_mime (1.0.0)
|
||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.3.0)
|
||||||
minitest (5.10.3)
|
minitest (5.11.1)
|
||||||
momentjs-rails (2.17.1)
|
momentjs-rails (2.17.1)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
multi_json (1.12.2)
|
multi_json (1.13.1)
|
||||||
multi_test (0.1.2)
|
multi_test (0.1.2)
|
||||||
nested_form_fields (0.8.2)
|
nested_form_fields (0.8.2)
|
||||||
coffee-rails (>= 3.2.1)
|
coffee-rails (>= 3.2.1)
|
||||||
jquery-rails
|
jquery-rails
|
||||||
rails (>= 3.2.0)
|
rails (>= 3.2.0)
|
||||||
newrelic_rpm (4.5.0.337)
|
newrelic_rpm (4.7.1.340)
|
||||||
nio4r (2.1.0)
|
nio4r (2.2.0)
|
||||||
nokogiri (1.6.8.1)
|
nokogiri (1.8.1)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
nokogumbo (1.4.13)
|
nokogumbo (1.4.13)
|
||||||
nokogiri
|
nokogiri
|
||||||
oj (2.18.5)
|
oj (3.3.10)
|
||||||
|
omniauth (1.8.1)
|
||||||
|
hashie (>= 3.4.6, < 3.6.0)
|
||||||
|
rack (>= 1.6.2, < 3)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paperclip (5.1.0)
|
paperclip (5.1.0)
|
||||||
activemodel (>= 4.2.0)
|
activemodel (>= 4.2.0)
|
||||||
|
@ -311,27 +313,27 @@ GEM
|
||||||
cocaine (~> 0.5.5)
|
cocaine (~> 0.5.5)
|
||||||
mime-types
|
mime-types
|
||||||
mimemagic (~> 0.3.0)
|
mimemagic (~> 0.3.0)
|
||||||
parallel (1.12.0)
|
parallel (1.12.1)
|
||||||
parser (2.4.0.0)
|
parser (2.4.0.2)
|
||||||
ast (~> 2.2)
|
ast (~> 2.3)
|
||||||
pg (0.21.0)
|
pg (0.21.0)
|
||||||
phantomjs (2.1.1.0)
|
phantomjs (2.1.1.0)
|
||||||
poltergeist (1.16.0)
|
poltergeist (1.17.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
polyglot (0.3.5)
|
polyglot (0.3.5)
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
pry (0.11.2)
|
pry (0.11.3)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.9.0)
|
method_source (~> 0.9.0)
|
||||||
pry-byebug (3.5.0)
|
pry-byebug (3.5.1)
|
||||||
byebug (~> 9.1)
|
byebug (~> 9.1)
|
||||||
pry (~> 0.10)
|
pry (~> 0.10)
|
||||||
pry-rails (0.3.6)
|
pry-rails (0.3.6)
|
||||||
pry (>= 0.10.4)
|
pry (>= 0.10.4)
|
||||||
public_suffix (3.0.1)
|
public_suffix (3.0.1)
|
||||||
puma (3.10.0)
|
puma (3.11.2)
|
||||||
rack (2.0.3)
|
rack (2.0.3)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
|
@ -371,12 +373,12 @@ GEM
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.2.2)
|
rainbow (2.2.2)
|
||||||
rake
|
rake
|
||||||
rake (12.1.0)
|
rake (12.3.0)
|
||||||
rb-fsevent (0.10.2)
|
rb-fsevent (0.10.2)
|
||||||
rb-inotify (0.9.10)
|
rb-inotify (0.9.10)
|
||||||
ffi (>= 0.5.0, < 2)
|
ffi (>= 0.5.0, < 2)
|
||||||
rdoc (4.3.0)
|
rdoc (4.3.0)
|
||||||
recaptcha (4.6.2)
|
recaptcha (4.6.3)
|
||||||
json
|
json
|
||||||
remotipart (1.3.1)
|
remotipart (1.3.1)
|
||||||
responders (2.4.0)
|
responders (2.4.0)
|
||||||
|
@ -389,7 +391,7 @@ GEM
|
||||||
roo (2.7.1)
|
roo (2.7.1)
|
||||||
nokogiri (~> 1)
|
nokogiri (~> 1)
|
||||||
rubyzip (~> 1.1, < 2.0.0)
|
rubyzip (~> 1.1, < 2.0.0)
|
||||||
rspec-core (3.7.0)
|
rspec-core (3.7.1)
|
||||||
rspec-support (~> 3.7.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-expectations (3.7.0)
|
rspec-expectations (3.7.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
|
@ -397,7 +399,7 @@ GEM
|
||||||
rspec-mocks (3.7.0)
|
rspec-mocks (3.7.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.7.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-rails (3.7.1)
|
rspec-rails (3.7.2)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
|
@ -421,19 +423,23 @@ GEM
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.4.4)
|
nokogiri (>= 1.4.4)
|
||||||
nokogumbo (~> 1.4.1)
|
nokogumbo (~> 1.4.1)
|
||||||
sass (3.4.25)
|
sass (3.5.5)
|
||||||
sass-rails (5.0.6)
|
sass-listen (~> 4.0.0)
|
||||||
|
sass-listen (4.0.0)
|
||||||
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||||
|
rb-inotify (~> 0.9, >= 0.9.7)
|
||||||
|
sass-rails (5.0.7)
|
||||||
railties (>= 4.0.0, < 6)
|
railties (>= 4.0.0, < 6)
|
||||||
sass (~> 3.1)
|
sass (~> 3.1)
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
scenic (1.4.0)
|
scenic (1.4.1)
|
||||||
activerecord (>= 4.0.0)
|
activerecord (>= 4.0.0)
|
||||||
railties (>= 4.0.0)
|
railties (>= 4.0.0)
|
||||||
scss_lint (0.55.0)
|
scss_lint (0.56.0)
|
||||||
rake (>= 0.9, < 13)
|
rake (>= 0.9, < 13)
|
||||||
sass (~> 3.4.20)
|
sass (~> 3.5.3)
|
||||||
sdoc (0.4.2)
|
sdoc (0.4.2)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
|
@ -459,12 +465,12 @@ GEM
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
starscope (1.5.5)
|
starscope (1.5.6)
|
||||||
babel-transpiler (~> 0.7)
|
babel-transpiler (~> 0.7)
|
||||||
oj (~> 2.9)
|
oj (~> 3.3)
|
||||||
parser (~> 2.3)
|
parser (~> 2.4)
|
||||||
rkelly-remix (~> 0.0.7)
|
rkelly-remix (~> 0.0.7)
|
||||||
ruby-progressbar (~> 1.8)
|
ruby-progressbar (~> 1.9)
|
||||||
sourcemap (~> 0.1)
|
sourcemap (~> 0.1)
|
||||||
stream (0.5)
|
stream (0.5)
|
||||||
thor (0.20.0)
|
thor (0.20.0)
|
||||||
|
@ -472,16 +478,15 @@ GEM
|
||||||
tilt (2.0.8)
|
tilt (2.0.8)
|
||||||
tinymce-rails (4.6.7)
|
tinymce-rails (4.6.7)
|
||||||
railties (>= 3.1.1)
|
railties (>= 3.1.1)
|
||||||
turbolinks (5.0.1)
|
turbolinks (2.5.4)
|
||||||
turbolinks-source (~> 5)
|
coffee-rails
|
||||||
turbolinks-source (5.0.3)
|
tzinfo (1.2.4)
|
||||||
tzinfo (1.2.3)
|
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (3.2.0)
|
uglifier (4.1.4)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
underscore-rails (1.8.3)
|
underscore-rails (1.8.3)
|
||||||
unicode-display_width (1.3.0)
|
unicode-display_width (1.3.0)
|
||||||
uniform_notifier (1.10.0)
|
uniform_notifier (1.11.0)
|
||||||
warden (1.2.7)
|
warden (1.2.7)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
webpacker (2.0)
|
webpacker (2.0)
|
||||||
|
@ -490,11 +495,12 @@ GEM
|
||||||
railties (>= 4.2)
|
railties (>= 4.2)
|
||||||
websocket-driver (0.6.5)
|
websocket-driver (0.6.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.3)
|
||||||
|
whacamole (1.2.0)
|
||||||
wicked_pdf (1.1.0)
|
wicked_pdf (1.1.0)
|
||||||
wkhtmltopdf-heroku (2.12.4.0)
|
wkhtmltopdf-heroku (2.12.4.0)
|
||||||
xpath (2.1.0)
|
xpath (3.0.0)
|
||||||
nokogiri (~> 1.3)
|
nokogiri (~> 1.8)
|
||||||
yomu (0.2.4)
|
yomu (0.2.4)
|
||||||
json (~> 1.8)
|
json (~> 1.8)
|
||||||
mime-types (~> 1.23)
|
mime-types (~> 1.23)
|
||||||
|
@ -525,7 +531,6 @@ DEPENDENCIES
|
||||||
capybara
|
capybara
|
||||||
capybara-email
|
capybara-email
|
||||||
commit_param_routing
|
commit_param_routing
|
||||||
creek
|
|
||||||
cucumber-rails (~> 1.5)
|
cucumber-rails (~> 1.5)
|
||||||
database_cleaner
|
database_cleaner
|
||||||
deface (~> 1.0)
|
deface (~> 1.0)
|
||||||
|
@ -535,7 +540,7 @@ DEPENDENCIES
|
||||||
devise-async!
|
devise-async!
|
||||||
devise_invitable
|
devise_invitable
|
||||||
devise_security_extension!
|
devise_security_extension!
|
||||||
factory_girl_rails
|
factory_bot_rails
|
||||||
faker
|
faker
|
||||||
figaro
|
figaro
|
||||||
font-awesome-rails (~> 4.7.0.2)
|
font-awesome-rails (~> 4.7.0.2)
|
||||||
|
@ -546,18 +551,20 @@ DEPENDENCIES
|
||||||
jquery-rails
|
jquery-rails
|
||||||
jquery-scrollto-rails!
|
jquery-scrollto-rails!
|
||||||
jquery-turbolinks
|
jquery-turbolinks
|
||||||
jquery-ui-rails (~> 5.0)
|
jquery-ui-rails
|
||||||
js_cookie_rails
|
js_cookie_rails
|
||||||
json_matchers
|
json_matchers
|
||||||
|
jwt
|
||||||
kaminari
|
kaminari
|
||||||
listen (~> 3.0)
|
listen (~> 3.0)
|
||||||
logging (~> 2.0.0)
|
logging (~> 2.0.0)
|
||||||
momentjs-rails (~> 2.17.1)
|
momentjs-rails (~> 2.17.1)
|
||||||
nested_form_fields
|
nested_form_fields
|
||||||
newrelic_rpm
|
newrelic_rpm
|
||||||
nokogiri
|
nokogiri (~> 1.8.1)
|
||||||
|
omniauth
|
||||||
paperclip (~> 5.1)
|
paperclip (~> 5.1)
|
||||||
pg
|
pg (~> 0.18)
|
||||||
phantomjs
|
phantomjs
|
||||||
poltergeist
|
poltergeist
|
||||||
pry
|
pry
|
||||||
|
@ -589,12 +596,13 @@ DEPENDENCIES
|
||||||
spinjs-rails
|
spinjs-rails
|
||||||
starscope
|
starscope
|
||||||
tinymce-rails (~> 4.6.4)
|
tinymce-rails (~> 4.6.4)
|
||||||
turbolinks
|
turbolinks (~> 2.0)
|
||||||
tzinfo-data
|
tzinfo-data
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
underscore-rails
|
underscore-rails
|
||||||
webpacker (~> 2.0)
|
webpacker (~> 2.0)
|
||||||
wicked_pdf
|
whacamole
|
||||||
|
wicked_pdf (~> 1.1.0)
|
||||||
wkhtmltopdf-heroku
|
wkhtmltopdf-heroku
|
||||||
yomu
|
yomu
|
||||||
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
// intentionally exports empty object
|
|
||||||
export default {};
|
|
|
@ -1,4 +1,4 @@
|
||||||
class AddUserIdentityTable < ActiveRecord::Migration
|
class AddUserIdentityTable < ActiveRecord::Migration[4.2]
|
||||||
def change
|
def change
|
||||||
create_table :user_identities do |t|
|
create_table :user_identities do |t|
|
||||||
t.belongs_to :user, index: true
|
t.belongs_to :user, index: true
|
||||||
|
|
11
db/schema.rb
11
db/schema.rb
|
@ -654,6 +654,17 @@ ActiveRecord::Schema.define(version: 20171026090804) do
|
||||||
t.integer "user_id", null: false
|
t.integer "user_id", null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "user_identities", id: :serial, force: :cascade do |t|
|
||||||
|
t.integer "user_id"
|
||||||
|
t.string "provider", null: false
|
||||||
|
t.string "uid", null: false
|
||||||
|
t.datetime "created_at"
|
||||||
|
t.datetime "updated_at"
|
||||||
|
t.index ["provider", "uid"], name: "index_user_identities_on_provider_and_uid", unique: true
|
||||||
|
t.index ["user_id", "provider"], name: "index_user_identities_on_user_id_and_provider", unique: true
|
||||||
|
t.index ["user_id"], name: "index_user_identities_on_user_id"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "user_my_modules", id: :serial, force: :cascade do |t|
|
create_table "user_my_modules", id: :serial, force: :cascade do |t|
|
||||||
t.integer "user_id", null: false
|
t.integer "user_id", null: false
|
||||||
t.integer "my_module_id", null: false
|
t.integer "my_module_id", null: false
|
||||||
|
|
|
@ -26,6 +26,7 @@ Feature: Sign up
|
||||||
| Full name | Email | Password | Password confirmation | Team name |
|
| Full name | Email | Password | Password confirmation | Team name |
|
||||||
| Magnus | magnus@gmail.com | asdf1234 | asdf1234 | SpliceGirls |
|
| Magnus | magnus@gmail.com | asdf1234 | asdf1234 | SpliceGirls |
|
||||||
And I click "Sign up" button
|
And I click "Sign up" button
|
||||||
|
And Show me the page
|
||||||
Then I should see "SpliceGirls"
|
Then I should see "SpliceGirls"
|
||||||
And I should be on homepage
|
And I should be on homepage
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ Then(/^I should be on homepage$/) do
|
||||||
end
|
end
|
||||||
|
|
||||||
Given(/^the "([^"]*)" team exists$/) do |team_name|
|
Given(/^the "([^"]*)" team exists$/) do |team_name|
|
||||||
FactoryGirl.create(:team, name: team_name)
|
FactoryBot.create(:team, name: team_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
Given(/^I'm on the home page of "([^"]*)" team$/) do |team_name|
|
Given(/^I'm on the home page of "([^"]*)" team$/) do |team_name|
|
||||||
|
@ -48,9 +48,9 @@ end
|
||||||
Given(/^"([^"]*)" is in "([^"]*)" team as a "([^"]*)"$/) do |user_email, team_name, role|
|
Given(/^"([^"]*)" is in "([^"]*)" team as a "([^"]*)"$/) do |user_email, team_name, role|
|
||||||
team = Team.find_by_name(team_name)
|
team = Team.find_by_name(team_name)
|
||||||
user = User.find_by_email(user_email)
|
user = User.find_by_email(user_email)
|
||||||
FactoryGirl.create(:user_team, user: user,
|
FactoryBot.create(:user_team, user: user,
|
||||||
team: team,
|
team: team, role:
|
||||||
role: UserTeam.roles.fetch(role))
|
UserTeam.roles.fetch(role))
|
||||||
end
|
end
|
||||||
|
|
||||||
Then(/^I attach a "([^"]*)" file to "([^"]*)" field$/) do |file, field_id|
|
Then(/^I attach a "([^"]*)" file to "([^"]*)" field$/) do |file, field_id|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Given(/^the following users are registered$/) do |table|
|
Given(/^the following users are registered$/) do |table|
|
||||||
table.hashes.each do |hash|
|
table.hashes.each do |hash|
|
||||||
FactoryGirl.create(:user, hash)
|
FactoryBot.create(:user, hash)
|
||||||
User.find_by_email(hash.fetch('email')).confirm
|
User.find_by_email(hash.fetch('email')).confirm
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,9 +27,9 @@ describe Api::ApiController, type: :controller do
|
||||||
|
|
||||||
context 'When valid request' do
|
context 'When valid request' do
|
||||||
before do
|
before do
|
||||||
post :authenticate, email: user.email,
|
post :authenticate, params: { email: user.email,
|
||||||
password: user.password,
|
password: user.password,
|
||||||
grant_type: 'password'
|
grant_type: 'password' }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Returns HTTP success' do
|
it 'Returns HTTP success' do
|
||||||
|
@ -47,17 +47,17 @@ describe Api::ApiController, type: :controller do
|
||||||
|
|
||||||
context 'When invalid password in request' do
|
context 'When invalid password in request' do
|
||||||
it 'Returns HTTP error' do
|
it 'Returns HTTP error' do
|
||||||
post :authenticate, email: user.email,
|
post :authenticate, params: { email: user.email,
|
||||||
password: 'wrong_password',
|
password: 'wrong_password',
|
||||||
grant_type: 'password'
|
grant_type: 'password' }
|
||||||
expect(response).to have_http_status(400)
|
expect(response).to have_http_status(400)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'When no grant_type in request' do
|
context 'When no grant_type in request' do
|
||||||
it 'Returns HTTP error' do
|
it 'Returns HTTP error' do
|
||||||
post :authenticate, email: user.email,
|
post :authenticate, params: { email: user.email,
|
||||||
password: user.password
|
password: user.password }
|
||||||
expect(response).to have_http_status(400)
|
expect(response).to have_http_status(400)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Api::V20170715::CoreApiController, type: :controller do
|
describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let!(:user) { create :user }
|
||||||
let(:task) { create(:my_module) }
|
let!(:team) { create :team, created_by: user }
|
||||||
let(:sample1) { create(:sample) }
|
let(:task) { create :my_module }
|
||||||
let(:sample2) { create(:sample) }
|
let(:sample1) { create :sample }
|
||||||
let(:sample3) { create(:sample) }
|
let(:sample2) { create :sample }
|
||||||
|
let(:sample3) { create :sample }
|
||||||
before do
|
before do
|
||||||
task.samples << [sample1, sample2, sample3]
|
task.samples << [sample1, sample2, sample3]
|
||||||
UserProject.create!(user: user, project: task.experiment.project, role: 0)
|
UserProject.create!(user: user, project: task.experiment.project, role: 0)
|
||||||
|
@ -16,7 +17,7 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
before do
|
before do
|
||||||
request.headers['HTTP_ACCEPT'] = 'application/json'
|
request.headers['HTTP_ACCEPT'] = 'application/json'
|
||||||
request.headers['Authorization'] = 'Bearer ' + generate_token(user.id)
|
request.headers['Authorization'] = 'Bearer ' + generate_token(user.id)
|
||||||
get :task_samples, task_id: task.id
|
get :task_samples, params: { task_id: task.id }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Returns HTTP success' do
|
it 'Returns HTTP success' do
|
||||||
|
@ -39,7 +40,7 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
before do
|
before do
|
||||||
request.headers['HTTP_ACCEPT'] = 'application/json'
|
request.headers['HTTP_ACCEPT'] = 'application/json'
|
||||||
request.headers['Authorization'] = 'Bearer WroNgToken'
|
request.headers['Authorization'] = 'Bearer WroNgToken'
|
||||||
get :task_samples, task_id: task.id
|
get :task_samples, params: { task_id: task.id }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Returns HTTP unauthorized' do
|
it 'Returns HTTP unauthorized' do
|
||||||
|
@ -54,7 +55,7 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'Returns HTTP not found' do
|
it 'Returns HTTP not found' do
|
||||||
get :task_samples, task_id: 1000
|
get :task_samples, params: { task_id: 1000 }
|
||||||
expect(response).to have_http_status(404)
|
expect(response).to have_http_status(404)
|
||||||
expect(json).to match({})
|
expect(json).to match({})
|
||||||
end
|
end
|
||||||
|
@ -63,7 +64,7 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
UserProject.where(user: user, project: task.experiment.project)
|
UserProject.where(user: user, project: task.experiment.project)
|
||||||
.first
|
.first
|
||||||
.destroy!
|
.destroy!
|
||||||
get :task_samples, task_id: task.id
|
get :task_samples, params: { task_id: task.id }
|
||||||
expect(response).to have_http_status(403)
|
expect(response).to have_http_status(403)
|
||||||
expect(json).to match({})
|
expect(json).to match({})
|
||||||
end
|
end
|
||||||
|
@ -72,6 +73,7 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #tasks_tree' do
|
describe 'GET #tasks_tree' do
|
||||||
|
let!(:user_team) { create :user_team, team: team, user: user }
|
||||||
context 'When valid request' do
|
context 'When valid request' do
|
||||||
before do
|
before do
|
||||||
request.headers['HTTP_ACCEPT'] = 'application/json'
|
request.headers['HTTP_ACCEPT'] = 'application/json'
|
||||||
|
@ -90,21 +92,25 @@ describe Api::V20170715::CoreApiController, type: :controller do
|
||||||
hash_body = nil
|
hash_body = nil
|
||||||
expect { hash_body = json }.not_to raise_exception
|
expect { hash_body = json }.not_to raise_exception
|
||||||
expect(hash_body).to match(
|
expect(hash_body).to match(
|
||||||
['team_id' => team.id.to_s, 'name' => team.name,
|
['name' => team.name,
|
||||||
'description' => team.description,
|
'description' => team.description,
|
||||||
|
'team_id' => team.id.to_s,
|
||||||
'projects' => [{
|
'projects' => [{
|
||||||
'project_id' => project.id.to_s, 'name' => project.name,
|
'name' => project.name,
|
||||||
'visibility' => project.visibility,
|
'visibility' => project.visibility,
|
||||||
'archived' => project.archived,
|
'archived' => project.archived,
|
||||||
|
'project_id' => project.id.to_s,
|
||||||
'experiments' => [{
|
'experiments' => [{
|
||||||
'experiment_id' => experiment.id.to_s,
|
|
||||||
'name' => experiment.name,
|
'name' => experiment.name,
|
||||||
'description' => experiment.description,
|
'description' => experiment.description,
|
||||||
'archived' => experiment.archived,
|
'archived' => experiment.archived,
|
||||||
|
'experiment_id' => experiment.id.to_s,
|
||||||
'tasks' => [{
|
'tasks' => [{
|
||||||
'task_id' => task.id.to_s, 'name' => task.name,
|
'name' => task.name,
|
||||||
'description' => task.description,
|
'description' => task.description,
|
||||||
'archived' => task.archived
|
'archived' => task.archived,
|
||||||
|
'task_id' => task.id.to_s,
|
||||||
|
'editable' => true
|
||||||
}]
|
}]
|
||||||
}]
|
}]
|
||||||
}]]
|
}]]
|
||||||
|
|
|
@ -5,12 +5,10 @@ describe ClientApi::Teams::TeamsController, type: :controller do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
@user_one = User.first
|
@user_one = User.first
|
||||||
@user_two = FactoryGirl.create :user, email: 'sec_user@asdf.com'
|
@user_two = create :user, email: 'sec_user@asdf.com'
|
||||||
@team_one = FactoryGirl.create :team, created_by: @user_one
|
@team_one = create :team, created_by: @user_one
|
||||||
@team_two = FactoryGirl.create :team,
|
@team_two = create :team, name: 'Team two', created_by: @user_two
|
||||||
name: 'Team two',
|
create :user_team, team: @team_one, user: @user_one, role: 2
|
||||||
created_by: @user_two
|
|
||||||
FactoryGirl.create :user_team, team: @team_one, user: @user_one, role: 2
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
|
@ -28,7 +26,7 @@ describe ClientApi::Teams::TeamsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return HTTP success response' do
|
it 'should return HTTP success response' do
|
||||||
post :create, params: { team: @team_one }, as: :json
|
post :create, params: { team: { name: 'My New Team' } }, as: :json
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -62,7 +60,7 @@ describe ClientApi::Teams::TeamsController, type: :controller do
|
||||||
|
|
||||||
describe 'POST #change_team' do
|
describe 'POST #change_team' do
|
||||||
it 'should return HTTP success response' do
|
it 'should return HTTP success response' do
|
||||||
FactoryGirl.create :user_team, team: @team_two, user: @user_one, role: 2
|
create :user_team, team: @team_two, user: @user_one, role: 2
|
||||||
@user_one.update_attribute(:current_team_id, @team_one.id)
|
@user_one.update_attribute(:current_team_id, @team_one.id)
|
||||||
post :change_team, params: { team_id: @team_two.id }, as: :json
|
post :change_team, params: { team_id: @team_two.id }, as: :json
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:ok)
|
||||||
|
@ -83,7 +81,7 @@ describe ClientApi::Teams::TeamsController, type: :controller do
|
||||||
|
|
||||||
describe 'GET #details' do
|
describe 'GET #details' do
|
||||||
it 'should return HTTP success response' do
|
it 'should return HTTP success response' do
|
||||||
FactoryGirl.create :user_team, team: @team_two, user: @user_one, role: 2
|
create :user_team, team: @team_two, user: @user_one, role: 2
|
||||||
@user_one.update_attribute(:current_team_id, @team_one.id)
|
@user_one.update_attribute(:current_team_id, @team_one.id)
|
||||||
get :details, params: { team_id: @team_two.id }, as: :json
|
get :details, params: { team_id: @team_two.id }, as: :json
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:ok)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :activity do
|
factory :activity do
|
||||||
type_of :create_project
|
type_of :create_project
|
||||||
message Faker::Lorem.sentence(10)
|
message Faker::Lorem.sentence(10)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :asset_text_datum do
|
factory :asset_text_datum do
|
||||||
data "Sample name\tSample type\n" + "sample6\tsample\n" + "\n"
|
data "Sample name\tSample type\n" + "sample6\tsample\n" + "\n"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :asset do
|
factory :asset do
|
||||||
association :created_by, factory: :project_user
|
association :created_by, factory: :project_user
|
||||||
association :team, factory: :team
|
association :team, factory: :team
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :custom_field do
|
factory :custom_field do
|
||||||
name 'My custom field'
|
name 'My custom field'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :experiment do
|
factory :experiment do
|
||||||
name 'My Experiment'
|
name 'My Experiment'
|
||||||
description 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'
|
description 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit.'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :my_module_group do
|
factory :my_module_group do
|
||||||
experiment { Experiment.first || create(:experiment_two) }
|
experiment { Experiment.first || create(:experiment_two) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :mm_repository_row, class: MyModuleRepositoryRow do
|
factory :mm_repository_row, class: MyModuleRepositoryRow do
|
||||||
association :repository_row, factory: :repository_row
|
association :repository_row, factory: :repository_row
|
||||||
association :my_module, factory: :my_module
|
association :my_module, factory: :my_module
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :my_module do
|
factory :my_module do
|
||||||
name 'My first module'
|
name 'My first module'
|
||||||
x 0
|
x 0
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :notification do
|
factory :notification do
|
||||||
title '<i>Admin</i> was added as Owner to project ' \
|
title '<i>Admin</i> was added as Owner to project ' \
|
||||||
'<strong>Demo project - qPCR</strong> by <i>User</i>.'
|
'<strong>Demo project - qPCR</strong> by <i>User</i>.'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :project do
|
factory :project do
|
||||||
created_by { User.first || association(:project_user) }
|
created_by { User.first || association(:project_user) }
|
||||||
team { Team.first || association(:project_team) }
|
team { Team.first || association(:project_team) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :report do
|
factory :report do
|
||||||
user { User.first || association(:user) }
|
user { User.first || association(:user) }
|
||||||
project { Project.first || association(:project) }
|
project { Project.first || association(:project) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :repository do
|
factory :repository do
|
||||||
name 'My Repository'
|
name 'My Repository'
|
||||||
created_by { User.first || create(:user) }
|
created_by { User.first || create(:user) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :repository_cell do
|
factory :repository_cell do
|
||||||
repository_row { RepositoryRow.first || create(:repository_row) }
|
repository_row { RepositoryRow.first || create(:repository_row) }
|
||||||
repository_column do
|
repository_column do
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :repository_column do
|
factory :repository_column do
|
||||||
name 'My Column'
|
name 'My Column'
|
||||||
created_by { User.first || create(:user) }
|
created_by { User.first || create(:user) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :repository_row do
|
factory :repository_row do
|
||||||
name 'Custom row'
|
name 'Custom row'
|
||||||
created_by { User.first || association(:user) }
|
created_by { User.first || association(:user) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :sample_group do
|
factory :sample_group do
|
||||||
name 'Sample'
|
name 'Sample'
|
||||||
color '#ff00ff'
|
color '#ff00ff'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :sample_my_module do
|
factory :sample_my_module do
|
||||||
sample { Sample.frist || create(:sample) }
|
sample { Sample.frist || create(:sample) }
|
||||||
my_module { MyModule.frist || create(:my_module) }
|
my_module { MyModule.frist || create(:my_module) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :sample_type do
|
factory :sample_type do
|
||||||
name 'Sample type'
|
name 'Sample type'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :sample do
|
factory :sample do
|
||||||
name 'Sample'
|
name 'Sample'
|
||||||
user { User.first || create(:user) }
|
user { User.first || create(:user) }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :samples_table do
|
factory :samples_table do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :team do
|
factory :team do
|
||||||
created_by { User.first || create(:user) }
|
created_by { User.first || create(:user) }
|
||||||
name 'My team'
|
name 'My team'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :user_notification do
|
factory :user_notification do
|
||||||
checked false
|
checked false
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :user_project do
|
factory :user_project do
|
||||||
role 'owner'
|
role 'owner'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :user_team do
|
factory :user_team do
|
||||||
role 'admin'
|
role 'admin'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
FactoryGirl.define do
|
FactoryBot.define do
|
||||||
factory :user do
|
factory :user do
|
||||||
full_name 'admin'
|
full_name 'admin'
|
||||||
initials 'AD'
|
initials 'AD'
|
||||||
email 'admin_test@scinote.net'
|
email 'admin_test@scinote.net'
|
||||||
password 'asdf1243'
|
password 'asdf1243'
|
||||||
password_confirmation 'asdf1243'
|
password_confirmation 'asdf1243'
|
||||||
after(:create) do |user|
|
|
||||||
user.teams << (Team.first || FactoryGirl.create(:team))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,20 +45,15 @@ describe Project, type: :model do
|
||||||
it { should validate_presence_of :visibility }
|
it { should validate_presence_of :visibility }
|
||||||
it { should validate_presence_of :team }
|
it { should validate_presence_of :team }
|
||||||
it do
|
it do
|
||||||
should validate_length_of(:name)
|
should validate_length_of(:name).is_at_least(Constants::NAME_MIN_LENGTH)
|
||||||
.is_at_least(Constants::NAME_MIN_LENGTH)
|
.is_at_most(Constants::NAME_MAX_LENGTH)
|
||||||
.is_at_most(Constants::NAME_MAX_LENGTH)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should have a unique name scoped to team' do
|
it 'should have a unique name scoped to team' do
|
||||||
FactoryGirl.create :project,
|
create :project, created_by: user, last_modified_by: user, team: team
|
||||||
created_by: user,
|
project_two = build :project, created_by: user,
|
||||||
last_modified_by: user,
|
last_modified_by: user,
|
||||||
team: team
|
team: team
|
||||||
project_two = FactoryGirl.build :project,
|
|
||||||
created_by: user,
|
|
||||||
last_modified_by: user,
|
|
||||||
team: team
|
|
||||||
expect(project_two).to_not be_valid
|
expect(project_two).to_not be_valid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -27,6 +27,7 @@ describe SampleGroup, type: :model do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'Should be a valid object' do
|
describe 'Should be a valid object' do
|
||||||
|
let!(:team_one) { create :team, name: 'My team' }
|
||||||
it { should validate_presence_of :name }
|
it { should validate_presence_of :name }
|
||||||
it { should validate_presence_of :color }
|
it { should validate_presence_of :color }
|
||||||
it { should validate_presence_of :team }
|
it { should validate_presence_of :team }
|
||||||
|
@ -37,9 +38,8 @@ describe SampleGroup, type: :model do
|
||||||
should validate_length_of(:color).is_at_most(Constants::COLOR_MAX_LENGTH)
|
should validate_length_of(:color).is_at_most(Constants::COLOR_MAX_LENGTH)
|
||||||
end
|
end
|
||||||
it 'should have uniq name scoped to team' do
|
it 'should have uniq name scoped to team' do
|
||||||
create :sample_group, name: 'My Group'
|
create :sample_group, name: 'My Group', team: team_one
|
||||||
new_group = build :sample_group, name: 'My Group'
|
new_group = build :sample_group, name: 'My Group', team: team_one
|
||||||
|
|
||||||
expect(new_group).to_not be_valid
|
expect(new_group).to_not be_valid
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -78,8 +78,8 @@ RSpec.configure do |config|
|
||||||
# arbitrary gems may also be filtered via:
|
# arbitrary gems may also be filtered via:
|
||||||
# config.filter_gems_from_backtrace("gem name")
|
# config.filter_gems_from_backtrace("gem name")
|
||||||
|
|
||||||
# includes FactoryGirl in rspec
|
# includes FactoryBot in rspec
|
||||||
config.include FactoryGirl::Syntax::Methods
|
config.include FactoryBot::Syntax::Methods
|
||||||
# Devise
|
# Devise
|
||||||
config.include Devise::Test::ControllerHelpers, type: :controller
|
config.include Devise::Test::ControllerHelpers, type: :controller
|
||||||
config.include ApiHelper, type: :controller
|
config.include ApiHelper, type: :controller
|
||||||
|
|
|
@ -2,7 +2,7 @@ module ControllerMacros
|
||||||
def login_user
|
def login_user
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@request.env['devise.mapping'] = Devise.mappings[:user]
|
@request.env['devise.mapping'] = Devise.mappings[:user]
|
||||||
user = FactoryGirl.create(:user)
|
user = create :user
|
||||||
user.confirm
|
user.confirm
|
||||||
sign_in user
|
sign_in user
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue