bundle update, fixed dependencies, tests passsing, everything up do date!
parent
11f0ee1ca9
commit
9cc3c26ba9
60
Gemfile
60
Gemfile
|
@ -3,20 +3,20 @@ source 'http://rails-assets.org'
|
|||
|
||||
ruby "2.1.5"
|
||||
|
||||
|
||||
# Base
|
||||
########################
|
||||
|
||||
gem 'rails', '4.1.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||
gem 'sqlite3' # Use sqlite3 as the database for Active Record
|
||||
gem 'rails', '~> 4.1.12' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
||||
gem 'sqlite3' # Use sqlite3 as the database for Active Record
|
||||
gem 'unicorn' # Use unicorn as the app server
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
||||
|
||||
# Assets
|
||||
########################
|
||||
|
||||
group :development, :test, :assets do
|
||||
gem 'sass-rails', github: 'rails/sass-rails' # SASS bindins for Rails
|
||||
gem 'sass', '~> 3.3.0' # CSS with superpowers
|
||||
gem 'compass', github: 'Compass/compass' # SASS on steroids
|
||||
gem 'sass-rails'#, github: 'rails/sass-rails' # SASS bindins for Rails
|
||||
gem 'sass', '~> 3.4.0' # CSS with superpowers
|
||||
gem 'compass-rails', github: 'Compass/compass-rails' # Compass bindings for Rails
|
||||
gem 'breakpoint' # Media queries sugar
|
||||
gem 'susy', '~> 2.0' # Grids for SASS
|
||||
|
@ -27,37 +27,38 @@ group :development, :test, :assets do
|
|||
gem 'turbolinks' # Turbolinks makes following links in your web application faster
|
||||
gem 'selenium-webdriver'
|
||||
gem 'database_cleaner'
|
||||
gem 'bourbon', '~> 4.2'
|
||||
end
|
||||
|
||||
# Views
|
||||
########################
|
||||
gem 'font-awesome-sass', '~> 4.3.0'
|
||||
gem 'haml-rails'
|
||||
gem 'auto_html'
|
||||
gem 'rack-zippy'
|
||||
gem 'jquery-ui-rails'
|
||||
gem 'rack-zippy' # Serves static gzipped precompiled assets
|
||||
gem 'kaminari'
|
||||
|
||||
group :production do
|
||||
gem 'aws-sdk', '< 2.0'
|
||||
end
|
||||
gem 'formtastic'
|
||||
|
||||
# Models
|
||||
########################
|
||||
|
||||
gem 'paperclip', github: 'thoughtbot/paperclip'
|
||||
gem 'paperclip'
|
||||
gem 'friendly_id'
|
||||
gem 'youtube_addy'
|
||||
gem 'cocoon'
|
||||
|
||||
# General
|
||||
# Users / Authentication / Administration
|
||||
########################
|
||||
|
||||
gem 'activeadmin', github: 'gregbell/active_admin' # Administration panel for Rails. Fantastic.
|
||||
gem 'devise' # Authentication system
|
||||
gem 'activeadmin', '~> 1.0.0.pre1' # Administration panel for Rails. Fantastic.
|
||||
gem 'devise' # Authentication system
|
||||
gem 'cancancan' # Authorization adapter
|
||||
# gem 'jbuilder', '~> 2.0' # Build JSON APIs with ease
|
||||
# gem 'sdoc', '~> 0.4.0', group: :doc # bundle exec rake doc:rails generates the API under doc/api.
|
||||
# gem 'simple_form'
|
||||
|
||||
# Other
|
||||
#######################
|
||||
gem 'reverse_markdown'
|
||||
gem 'nokogiri' # To parse HTML, for the scraper
|
||||
|
||||
# Testing
|
||||
#######################
|
||||
|
||||
group :development do
|
||||
gem 'spring' # Spring speeds up development by keeping your application running in the background
|
||||
|
@ -79,12 +80,17 @@ group :test do
|
|||
gem 'vcr'
|
||||
end
|
||||
|
||||
gem 'nokogiri' # To parse HTML, for the scrapper
|
||||
# Production
|
||||
#######################
|
||||
|
||||
group :production do
|
||||
gem 'aws-sdk', '< 2.0'
|
||||
end
|
||||
|
||||
# gem 'jbuilder', '~> 2.0' # Build JSON APIs with ease
|
||||
# gem 'sdoc', '~> 0.4.0', group: :doc # bundle exec rake doc:rails generates the API under doc/api.
|
||||
|
||||
# gem 'bcrypt', '~> 3.1.7' # Use ActiveModel has_secure_password
|
||||
gem 'unicorn' # Use unicorn as the app server
|
||||
|
||||
# gem 'capistrano-rails', group: :development # Use Capistrano for deployment
|
||||
# gem 'debugger', group: [:development, :test] # Use debugger
|
||||
|
||||
|
||||
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
|
||||
# gem 'debugger', group: [:development, :test] # Use debugger
|
784
Gemfile.lock
784
Gemfile.lock
|
@ -1,401 +1,383 @@
|
|||
GIT
|
||||
remote: git://github.com/Compass/compass-rails.git
|
||||
revision: 5067c08c4c7d801f76bdad5bd6c6945dd18ffd2f
|
||||
specs:
|
||||
compass-rails (2.0.0.pre)
|
||||
compass (>= 0.12.2)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/Compass/compass.git
|
||||
revision: b091fe0c23338f062463476c813042b0dd902ae6
|
||||
specs:
|
||||
compass (1.0.0.alpha.20)
|
||||
chunky_png (~> 1.2)
|
||||
compass-core (~> 1.0.0.alpha.20)
|
||||
compass-import-once (~> 1.0.4)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-core (1.0.0.alpha.20)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.4)
|
||||
sass (>= 3.2, < 3.5)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/gregbell/active_admin.git
|
||||
revision: 9cfc45330e5ad31977b3ac7b2ccc1f8d6146c73f
|
||||
specs:
|
||||
activeadmin (1.0.0.pre)
|
||||
arbre (~> 1.0)
|
||||
bourbon
|
||||
coffee-rails
|
||||
formtastic (~> 2.3.0.rc3)
|
||||
inherited_resources (~> 1.4.1)
|
||||
jquery-rails
|
||||
jquery-ui-rails (~> 5.0)
|
||||
kaminari (~> 0.15)
|
||||
rails (>= 3.2, < 4.2)
|
||||
ransack (~> 1.0)
|
||||
sass-rails
|
||||
|
||||
GIT
|
||||
remote: git://github.com/rails/sass-rails.git
|
||||
revision: 3a9e47db7d769221157c82229fc1bade55b580f0
|
||||
specs:
|
||||
sass-rails (4.0.1)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
sass (~> 3.2)
|
||||
sprockets (~> 2.12)
|
||||
sprockets-rails (~> 2.0)
|
||||
|
||||
GIT
|
||||
remote: git://github.com/thoughtbot/paperclip.git
|
||||
revision: dca87ec5d8038b2d436a75ad6119c8eb67b73e70
|
||||
specs:
|
||||
paperclip (4.2.0)
|
||||
activemodel (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
cocaine (~> 0.5.3)
|
||||
mime-types
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
remote: http://rails-assets.org/
|
||||
specs:
|
||||
actionmailer (4.1.1)
|
||||
actionpack (= 4.1.1)
|
||||
actionview (= 4.1.1)
|
||||
mail (~> 2.5.4)
|
||||
actionpack (4.1.1)
|
||||
actionview (= 4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
rack (~> 1.5.2)
|
||||
rack-test (~> 0.6.2)
|
||||
actionview (4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
activemodel (4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.1.1)
|
||||
activemodel (= 4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
arel (~> 5.0.0)
|
||||
activesupport (4.1.1)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.6)
|
||||
arbre (1.0.1)
|
||||
activesupport (>= 3.0.0)
|
||||
arel (5.0.1.20140414130214)
|
||||
auto_html (1.6.4)
|
||||
redcarpet (~> 3.1)
|
||||
rinku (~> 1.5.0)
|
||||
aws-sdk (1.64.0)
|
||||
aws-sdk-v1 (= 1.64.0)
|
||||
aws-sdk-v1 (1.64.0)
|
||||
json (~> 1.4)
|
||||
nokogiri (>= 1.4.4)
|
||||
bcrypt (3.1.9)
|
||||
bcrypt (3.1.9-x64-mingw32)
|
||||
bourbon (4.0.2)
|
||||
sass (~> 3.3)
|
||||
thor
|
||||
breakpoint (2.0.7)
|
||||
compass (>= 0.12.1)
|
||||
sass (>= 3.2.0)
|
||||
builder (3.2.2)
|
||||
cancancan (1.9.2)
|
||||
capybara (2.4.4)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
celluloid (0.15.2)
|
||||
timers (~> 1.1.0)
|
||||
childprocess (0.5.5)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
chunky_png (1.3.1)
|
||||
climate_control (0.0.3)
|
||||
activesupport (>= 3.0)
|
||||
cocaine (0.5.4)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
cocoon (1.2.6)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (4.0.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
coffee-script (2.2.0)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.7.0)
|
||||
crack (0.4.2)
|
||||
safe_yaml (~> 1.0.0)
|
||||
database_cleaner (1.3.0)
|
||||
devise (3.2.4)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
thread_safe (~> 0.1)
|
||||
warden (~> 1.2.3)
|
||||
diff-lcs (1.2.5)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.0.4)
|
||||
execjs (2.2.1)
|
||||
factory_girl (4.4.0)
|
||||
activesupport (>= 3.0.0)
|
||||
factory_girl_rails (4.4.1)
|
||||
factory_girl (~> 4.4.0)
|
||||
railties (>= 3.0.0)
|
||||
ffi (1.9.6)
|
||||
ffi (1.9.6-x64-mingw32)
|
||||
font-awesome-sass (4.3.2.1)
|
||||
sass (~> 3.2)
|
||||
forgery (0.6.0)
|
||||
formatador (0.2.5)
|
||||
formtastic (2.3.0.rc3)
|
||||
actionpack (>= 3.0)
|
||||
friendly_id (5.1.0)
|
||||
activerecord (>= 4.0.0)
|
||||
guard (2.6.1)
|
||||
formatador (>= 0.2.4)
|
||||
listen (~> 2.7)
|
||||
lumberjack (~> 1.0)
|
||||
pry (>= 0.9.12)
|
||||
thor (>= 0.18.1)
|
||||
guard-livereload (2.3.0)
|
||||
em-websocket (~> 0.5)
|
||||
guard (~> 2.0)
|
||||
multi_json (~> 1.8)
|
||||
guard-rspec (4.2.10)
|
||||
guard (~> 2.1)
|
||||
rspec (>= 2.14, < 4.0)
|
||||
haml (4.0.5)
|
||||
tilt
|
||||
haml-rails (0.5.3)
|
||||
actionpack (>= 4.0.1)
|
||||
activesupport (>= 4.0.1)
|
||||
haml (>= 3.1, < 5.0)
|
||||
railties (>= 4.0.1)
|
||||
has_scope (0.6.0.rc)
|
||||
actionpack (>= 3.2, < 5)
|
||||
activesupport (>= 3.2, < 5)
|
||||
hike (1.2.3)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.7.0)
|
||||
inherited_resources (1.4.1)
|
||||
has_scope (~> 0.6.0.rc)
|
||||
responders (~> 1.0.0.rc)
|
||||
jquery-rails (3.1.1)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (5.0.0)
|
||||
railties (>= 3.2.16)
|
||||
json (1.8.3)
|
||||
kaminari (0.16.1)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.9.3)
|
||||
listen (2.7.9)
|
||||
celluloid (>= 0.15.2)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
lumberjack (1.0.9)
|
||||
mail (2.5.4)
|
||||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
method_source (0.8.2)
|
||||
mime-types (1.25.1)
|
||||
mini_portile (0.6.0)
|
||||
minitest (5.7.0)
|
||||
multi_json (1.10.1)
|
||||
nokogiri (1.6.3.1)
|
||||
mini_portile (= 0.6.0)
|
||||
nokogiri (1.6.3.1-x64-mingw32)
|
||||
mini_portile (= 0.6.0)
|
||||
orm_adapter (0.5.0)
|
||||
polyamorous (1.0.0)
|
||||
activerecord (>= 3.0)
|
||||
polyglot (0.3.5)
|
||||
pry (0.10.0)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
pry (0.10.0-x64-mingw32)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
win32console (~> 1.3)
|
||||
rack (1.5.2)
|
||||
rack-livereload (0.3.15)
|
||||
rack
|
||||
rack-test (0.6.2)
|
||||
rack (>= 1.0)
|
||||
rack-zippy (1.2.1)
|
||||
rails (4.1.1)
|
||||
actionmailer (= 4.1.1)
|
||||
actionpack (= 4.1.1)
|
||||
actionview (= 4.1.1)
|
||||
activemodel (= 4.1.1)
|
||||
activerecord (= 4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.1.1)
|
||||
sprockets-rails (~> 2.0)
|
||||
railties (4.1.1)
|
||||
actionpack (= 4.1.1)
|
||||
activesupport (= 4.1.1)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.14.0)
|
||||
rake (10.3.2)
|
||||
ransack (1.2.3)
|
||||
actionpack (>= 3.0)
|
||||
activerecord (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
i18n
|
||||
polyamorous (~> 1.0.0)
|
||||
rb-fsevent (0.9.4)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
redcarpet (3.1.2)
|
||||
responders (1.0.0)
|
||||
railties (>= 3.2, < 5)
|
||||
reverse_markdown (0.6.0)
|
||||
nokogiri
|
||||
rinku (1.5.1)
|
||||
rspec (3.0.0)
|
||||
rspec-core (~> 3.0.0)
|
||||
rspec-expectations (~> 3.0.0)
|
||||
rspec-mocks (~> 3.0.0)
|
||||
rspec-core (3.0.2)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-expectations (3.0.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-mocks (3.0.2)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-rails (3.0.1)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
rspec-core (~> 3.0.0)
|
||||
rspec-expectations (~> 3.0.0)
|
||||
rspec-mocks (~> 3.0.0)
|
||||
rspec-support (~> 3.0.0)
|
||||
rspec-support (3.0.2)
|
||||
rubyzip (1.1.6)
|
||||
safe_yaml (1.0.3)
|
||||
sass (3.3.14)
|
||||
selenium-webdriver (2.44.0)
|
||||
childprocess (~> 0.5)
|
||||
multi_json (~> 1.0)
|
||||
rubyzip (~> 1.0)
|
||||
websocket (~> 1.0)
|
||||
slop (3.5.0)
|
||||
spring (1.1.3)
|
||||
spring-commands-rspec (1.0.2)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (2.12.1)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-rails (2.1.3)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (~> 2.8)
|
||||
sqlite3 (1.3.10)
|
||||
sqlite3 (1.3.10-x64-mingw32)
|
||||
susy (2.1.1)
|
||||
sass (~> 3.3.0)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
timers (1.1.0)
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
turbolinks (2.2.2)
|
||||
coffee-rails
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo-data (1.2014.10)
|
||||
tzinfo (>= 1.0.0)
|
||||
uglifier (2.5.1)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
unicorn (4.9.0)
|
||||
kgio (~> 2.6)
|
||||
rack
|
||||
raindrops (~> 0.7)
|
||||
vcr (2.9.3)
|
||||
warden (1.2.3)
|
||||
rack (>= 1.0)
|
||||
webmock (1.18.0)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
websocket (1.2.1)
|
||||
win32console (1.3.2)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
youtube_addy (1.0.4)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
x64-mingw32
|
||||
|
||||
DEPENDENCIES
|
||||
activeadmin!
|
||||
auto_html
|
||||
aws-sdk (< 2.0)
|
||||
breakpoint
|
||||
cancancan
|
||||
capybara
|
||||
cocoon
|
||||
coffee-rails (~> 4.0.0)
|
||||
compass!
|
||||
compass-rails!
|
||||
database_cleaner
|
||||
devise
|
||||
factory_girl_rails
|
||||
font-awesome-sass (~> 4.3.0)
|
||||
forgery
|
||||
friendly_id
|
||||
guard-livereload
|
||||
guard-rspec
|
||||
haml-rails
|
||||
jquery-rails
|
||||
jquery-ui-rails
|
||||
kaminari
|
||||
nokogiri
|
||||
paperclip!
|
||||
rack-livereload
|
||||
rack-zippy
|
||||
rails (= 4.1.1)
|
||||
redcarpet
|
||||
reverse_markdown
|
||||
rspec-rails
|
||||
sass (~> 3.3.0)
|
||||
sass-rails!
|
||||
selenium-webdriver
|
||||
spring
|
||||
spring-commands-rspec
|
||||
sqlite3
|
||||
susy (~> 2.0)
|
||||
turbolinks
|
||||
tzinfo-data
|
||||
uglifier (>= 1.3.0)
|
||||
unicorn
|
||||
vcr
|
||||
webmock
|
||||
youtube_addy
|
||||
GIT
|
||||
remote: git://github.com/Compass/compass-rails.git
|
||||
revision: 3e88f991150ffa39b0a539dffb3326248d18e6ad
|
||||
specs:
|
||||
compass-rails (2.0.4)
|
||||
compass (~> 1.0.0)
|
||||
sass-rails (< 5.1)
|
||||
sprockets (< 2.13)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
remote: http://rails-assets.org/
|
||||
specs:
|
||||
actionmailer (4.1.12)
|
||||
actionpack (= 4.1.12)
|
||||
actionview (= 4.1.12)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
actionpack (4.1.12)
|
||||
actionview (= 4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
rack (~> 1.5.2)
|
||||
rack-test (~> 0.6.2)
|
||||
actionview (4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
activeadmin (1.0.0.pre1)
|
||||
arbre (~> 1.0, >= 1.0.2)
|
||||
bourbon
|
||||
coffee-rails
|
||||
formtastic (~> 3.1)
|
||||
formtastic_i18n
|
||||
inherited_resources (~> 1.6)
|
||||
jquery-rails
|
||||
jquery-ui-rails (~> 5.0)
|
||||
kaminari (~> 0.15)
|
||||
rails (>= 3.2, < 5.0)
|
||||
ransack (~> 1.3)
|
||||
sass-rails
|
||||
activemodel (4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.1.12)
|
||||
activemodel (= 4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
arel (~> 5.0.0)
|
||||
activesupport (4.1.12)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.3.8)
|
||||
arbre (1.0.3)
|
||||
activesupport (>= 3.0.0)
|
||||
arel (5.0.1.20140414130214)
|
||||
aws-sdk (1.64.0)
|
||||
aws-sdk-v1 (= 1.64.0)
|
||||
aws-sdk-v1 (1.64.0)
|
||||
json (~> 1.4)
|
||||
nokogiri (>= 1.4.4)
|
||||
bcrypt (3.1.10)
|
||||
bourbon (4.2.3)
|
||||
sass (~> 3.4)
|
||||
thor
|
||||
breakpoint (2.5.0)
|
||||
sass (~> 3.3)
|
||||
sassy-maps (< 1.0.0)
|
||||
builder (3.2.2)
|
||||
cancancan (1.12.0)
|
||||
capybara (2.4.4)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
childprocess (0.5.6)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
chunky_png (1.3.4)
|
||||
climate_control (0.0.3)
|
||||
activesupport (>= 3.0)
|
||||
cocaine (0.5.7)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
cocoon (1.2.6)
|
||||
coderay (1.1.0)
|
||||
coffee-rails (4.0.1)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
compass (1.0.3)
|
||||
chunky_png (~> 1.2)
|
||||
compass-core (~> 1.0.2)
|
||||
compass-import-once (~> 1.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.13, < 3.5)
|
||||
compass-core (1.0.3)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
crack (0.4.2)
|
||||
safe_yaml (~> 1.0.0)
|
||||
database_cleaner (1.4.1)
|
||||
devise (3.5.1)
|
||||
bcrypt (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
responders
|
||||
thread_safe (~> 0.1)
|
||||
warden (~> 1.2.3)
|
||||
diff-lcs (1.2.5)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.0.7)
|
||||
execjs (2.5.2)
|
||||
factory_girl (4.5.0)
|
||||
activesupport (>= 3.0.0)
|
||||
factory_girl_rails (4.5.0)
|
||||
factory_girl (~> 4.5.0)
|
||||
railties (>= 3.0.0)
|
||||
ffi (1.9.10)
|
||||
font-awesome-sass (4.3.2.1)
|
||||
sass (~> 3.2)
|
||||
forgery (0.6.0)
|
||||
formatador (0.2.5)
|
||||
formtastic (3.1.3)
|
||||
actionpack (>= 3.2.13)
|
||||
formtastic_i18n (0.4.1)
|
||||
friendly_id (5.1.0)
|
||||
activerecord (>= 4.0.0)
|
||||
guard (2.12.8)
|
||||
formatador (>= 0.2.4)
|
||||
listen (>= 2.7, <= 4.0)
|
||||
lumberjack (~> 1.0)
|
||||
nenv (~> 0.1)
|
||||
notiffany (~> 0.0)
|
||||
pry (>= 0.9.12)
|
||||
shellany (~> 0.0)
|
||||
thor (>= 0.18.1)
|
||||
guard-compat (1.2.1)
|
||||
guard-livereload (2.4.0)
|
||||
em-websocket (~> 0.5)
|
||||
guard (~> 2.8)
|
||||
multi_json (~> 1.8)
|
||||
guard-rspec (4.6.2)
|
||||
guard (~> 2.1)
|
||||
guard-compat (~> 1.1)
|
||||
rspec (>= 2.99.0, < 4.0)
|
||||
haml (4.0.6)
|
||||
tilt
|
||||
haml-rails (0.9.0)
|
||||
actionpack (>= 4.0.1)
|
||||
activesupport (>= 4.0.1)
|
||||
haml (>= 4.0.6, < 5.0)
|
||||
html2haml (>= 1.0.1)
|
||||
railties (>= 4.0.1)
|
||||
has_scope (0.6.0)
|
||||
actionpack (>= 3.2, < 5)
|
||||
activesupport (>= 3.2, < 5)
|
||||
hike (1.2.3)
|
||||
html2haml (2.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
haml (~> 4.0.0)
|
||||
nokogiri (~> 1.6.0)
|
||||
ruby_parser (~> 3.5)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.7.0)
|
||||
inherited_resources (1.6.0)
|
||||
actionpack (>= 3.2, < 5)
|
||||
has_scope (~> 0.6.0.rc)
|
||||
railties (>= 3.2, < 5)
|
||||
responders
|
||||
jquery-rails (3.1.3)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (5.0.5)
|
||||
railties (>= 3.2.16)
|
||||
json (1.8.3)
|
||||
kaminari (0.16.3)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.9.3)
|
||||
listen (3.0.2)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
lumberjack (1.0.9)
|
||||
mail (2.6.3)
|
||||
mime-types (>= 1.16, < 3)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.6.1)
|
||||
mimemagic (0.3.0)
|
||||
mini_portile (0.6.2)
|
||||
minitest (5.7.0)
|
||||
multi_json (1.11.2)
|
||||
nenv (0.2.0)
|
||||
nokogiri (1.6.6.2)
|
||||
mini_portile (~> 0.6.0)
|
||||
notiffany (0.0.6)
|
||||
nenv (~> 0.1)
|
||||
shellany (~> 0.0)
|
||||
orm_adapter (0.5.0)
|
||||
paperclip (4.3.0)
|
||||
activemodel (>= 3.2.0)
|
||||
activesupport (>= 3.2.0)
|
||||
cocaine (~> 0.5.5)
|
||||
mime-types
|
||||
mimemagic (= 0.3.0)
|
||||
polyamorous (1.2.0)
|
||||
activerecord (>= 3.0)
|
||||
pry (0.10.1)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
rack (1.5.5)
|
||||
rack-livereload (0.3.16)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rack-zippy (3.0.1)
|
||||
rails (4.1.12)
|
||||
actionmailer (= 4.1.12)
|
||||
actionpack (= 4.1.12)
|
||||
actionview (= 4.1.12)
|
||||
activemodel (= 4.1.12)
|
||||
activerecord (= 4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.1.12)
|
||||
sprockets-rails (~> 2.0)
|
||||
railties (4.1.12)
|
||||
actionpack (= 4.1.12)
|
||||
activesupport (= 4.1.12)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.14.0)
|
||||
rake (10.4.2)
|
||||
ransack (1.6.6)
|
||||
actionpack (>= 3.0)
|
||||
activerecord (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
i18n
|
||||
polyamorous (~> 1.2)
|
||||
rb-fsevent (0.9.5)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
redcarpet (3.3.2)
|
||||
responders (1.1.2)
|
||||
railties (>= 3.2, < 4.2)
|
||||
reverse_markdown (0.8.2)
|
||||
nokogiri
|
||||
rspec (3.3.0)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-core (3.3.2)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-expectations (3.3.1)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-mocks (3.3.2)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-rails (3.3.3)
|
||||
actionpack (>= 3.0, < 4.3)
|
||||
activesupport (>= 3.0, < 4.3)
|
||||
railties (>= 3.0, < 4.3)
|
||||
rspec-core (~> 3.3.0)
|
||||
rspec-expectations (~> 3.3.0)
|
||||
rspec-mocks (~> 3.3.0)
|
||||
rspec-support (~> 3.3.0)
|
||||
rspec-support (3.3.0)
|
||||
ruby_parser (3.7.0)
|
||||
sexp_processor (~> 4.1)
|
||||
rubyzip (1.1.7)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.4.16)
|
||||
sass-rails (5.0.3)
|
||||
railties (>= 4.0.0, < 5.0)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (~> 1.1)
|
||||
sassy-maps (0.4.0)
|
||||
sass (~> 3.3)
|
||||
selenium-webdriver (2.46.2)
|
||||
childprocess (~> 0.5)
|
||||
multi_json (~> 1.0)
|
||||
rubyzip (~> 1.0)
|
||||
websocket (~> 1.0)
|
||||
sexp_processor (4.6.0)
|
||||
shellany (0.0.1)
|
||||
slop (3.6.0)
|
||||
spring (1.3.6)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (2.12.4)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-rails (2.3.2)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sqlite3 (1.3.10)
|
||||
susy (2.2.5)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
turbolinks (2.5.3)
|
||||
coffee-rails
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uglifier (2.7.1)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
unicorn (4.9.0)
|
||||
kgio (~> 2.6)
|
||||
rack
|
||||
raindrops (~> 0.7)
|
||||
vcr (2.9.3)
|
||||
warden (1.2.3)
|
||||
rack (>= 1.0)
|
||||
webmock (1.21.0)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
websocket (1.2.2)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
activeadmin (~> 1.0.0.pre1)
|
||||
aws-sdk (< 2.0)
|
||||
bourbon (~> 4.2)
|
||||
breakpoint
|
||||
cancancan
|
||||
capybara
|
||||
cocoon
|
||||
coffee-rails (~> 4.0.0)
|
||||
compass-rails!
|
||||
database_cleaner
|
||||
devise
|
||||
factory_girl_rails
|
||||
font-awesome-sass (~> 4.3.0)
|
||||
forgery
|
||||
formtastic
|
||||
friendly_id
|
||||
guard-livereload
|
||||
guard-rspec
|
||||
haml-rails
|
||||
jquery-rails
|
||||
kaminari
|
||||
nokogiri
|
||||
paperclip
|
||||
rack-livereload
|
||||
rack-zippy
|
||||
rails (~> 4.1.12)
|
||||
redcarpet
|
||||
reverse_markdown
|
||||
rspec-rails
|
||||
sass (~> 3.4.0)
|
||||
sass-rails
|
||||
selenium-webdriver
|
||||
spring
|
||||
spring-commands-rspec
|
||||
sqlite3
|
||||
susy (~> 2.0)
|
||||
turbolinks
|
||||
tzinfo-data
|
||||
uglifier (>= 1.3.0)
|
||||
unicorn
|
||||
vcr
|
||||
webmock
|
||||
|
|
|
@ -34,7 +34,7 @@ ActiveAdmin.register ForumPost do
|
|||
render json: {}
|
||||
end
|
||||
|
||||
action_item do
|
||||
action_item :scrap do
|
||||
link_to icon('spin') + ' Scrap',
|
||||
[:scrap, :admin, :forum_posts],
|
||||
id: 'scrap-forum-posts',
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
// Active Admin's got SASS!
|
||||
@import "active_admin/mixins"
|
||||
@import "active_admin/base"
|
||||
// @import "active_admin/base"
|
||||
|
||||
// Overriding any non-variable SASS must be done after the fact.
|
||||
// For example, to change the default status-tag color:
|
|
@ -1,67 +0,0 @@
|
|||
class ModAsset < ActiveRecord::Base
|
||||
|
||||
belongs_to :mod_version
|
||||
belongs_to :mod
|
||||
|
||||
has_attached_file :image, styles: { medium: '300x300^', thumb: '150x150#', full: '1920x1080>' }
|
||||
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
|
||||
|
||||
### Scopes
|
||||
###############
|
||||
|
||||
scope :sort_by_older_to_newer, -> { order('sort_order asc') }
|
||||
|
||||
### Validations
|
||||
###############
|
||||
|
||||
validate :has_image_or_video?
|
||||
validate :valid_video_provider?, if: :video?
|
||||
|
||||
def has_image_or_video?
|
||||
if video? == !image.blank? # if not nothing, or if everything
|
||||
errors[:base] << 'Asset should have a video XOR an image'
|
||||
end
|
||||
end
|
||||
|
||||
def valid_video_provider?
|
||||
if video_provider == :unknown
|
||||
errors[:video_url] << 'Invalid video provider, the only valid video provider is YouTube'
|
||||
end
|
||||
end
|
||||
|
||||
### Attributes
|
||||
##############
|
||||
|
||||
alias_attribute :version, :mod_version
|
||||
|
||||
delegate :number, to: :version, prefix: true
|
||||
|
||||
def video?
|
||||
!video_url.blank?
|
||||
end
|
||||
|
||||
def video_provider
|
||||
if video_url
|
||||
if YouTubeAddy.extract_video_id(video_url).kind_of? String
|
||||
return :youtube
|
||||
end
|
||||
end
|
||||
|
||||
:unknown
|
||||
end
|
||||
|
||||
def video_embed_url
|
||||
case video_provider
|
||||
when :youtube
|
||||
"http://www.youtube.com/embed/#{youtube_video_key}"
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def youtube_video_key
|
||||
YouTubeAddy.extract_video_id(video_url)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,110 @@
|
|||
# encoding: utf-8
|
||||
|
||||
# Set the default text field size when input is a string. Default is nil.
|
||||
# Formtastic::FormBuilder.default_text_field_size = 50
|
||||
|
||||
# Set the default text area height when input is a text. Default is 20.
|
||||
# Formtastic::FormBuilder.default_text_area_height = 5
|
||||
|
||||
# Set the default text area width when input is a text. Default is nil.
|
||||
# Formtastic::FormBuilder.default_text_area_width = 50
|
||||
|
||||
# Should all fields be considered "required" by default?
|
||||
# Defaults to true.
|
||||
# Formtastic::FormBuilder.all_fields_required_by_default = true
|
||||
|
||||
# Should select fields have a blank option/prompt by default?
|
||||
# Defaults to true.
|
||||
# Formtastic::FormBuilder.include_blank_for_select_by_default = true
|
||||
|
||||
# Set the string that will be appended to the labels/fieldsets which are required
|
||||
# It accepts string or procs and the default is a localized version of
|
||||
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
|
||||
# in your locale, it will replace the abbr title properly. But if you don't want to use
|
||||
# abbr tag, you can simply give a string as below
|
||||
# Formtastic::FormBuilder.required_string = "(required)"
|
||||
|
||||
# Set the string that will be appended to the labels/fieldsets which are optional
|
||||
# Defaults to an empty string ("") and also accepts procs (see required_string above)
|
||||
# Formtastic::FormBuilder.optional_string = "(optional)"
|
||||
|
||||
# Set the way inline errors will be displayed.
|
||||
# Defaults to :sentence, valid options are :sentence, :list, :first and :none
|
||||
# Formtastic::FormBuilder.inline_errors = :sentence
|
||||
# Formtastic uses the following classes as default for hints, inline_errors and error list
|
||||
|
||||
# If you override the class here, please ensure to override it in your stylesheets as well
|
||||
# Formtastic::FormBuilder.default_hint_class = "inline-hints"
|
||||
# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
|
||||
# Formtastic::FormBuilder.default_error_list_class = "errors"
|
||||
|
||||
# Set the method to call on label text to transform or format it for human-friendly
|
||||
# reading when formtastic is used without object. Defaults to :humanize.
|
||||
# Formtastic::FormBuilder.label_str_method = :humanize
|
||||
|
||||
# Set the array of methods to try calling on parent objects in :select and :radio inputs
|
||||
# for the text inside each @<option>@ tag or alongside each radio @<input>@. The first method
|
||||
# that is found on the object will be used.
|
||||
# Defaults to ["to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
||||
# Formtastic::FormBuilder.collection_label_methods = [
|
||||
# "to_label", "display_name", "full_name", "name", "title", "username", "login", "value", "to_s"]
|
||||
|
||||
# Specifies if labels/hints for input fields automatically be looked up using I18n.
|
||||
# Default value: true. Overridden for specific fields by setting value to true,
|
||||
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
|
||||
# Formtastic::FormBuilder.i18n_lookups_by_default = false
|
||||
|
||||
# Specifies if I18n lookups of the default I18n Localizer should be cached to improve performance.
|
||||
# Defaults to true.
|
||||
# Formtastic::FormBuilder.i18n_cache_lookups = false
|
||||
|
||||
# Specifies the class to use for localization lookups. You can create your own
|
||||
# class and use it instead by subclassing Formtastic::Localizer (which is the default).
|
||||
# Formtastic::FormBuilder.i18n_localizer = MyOwnLocalizer
|
||||
|
||||
# You can add custom inputs or override parts of Formtastic by subclassing Formtastic::FormBuilder and
|
||||
# specifying that class here. Defaults to Formtastic::FormBuilder.
|
||||
# Formtastic::Helpers::FormHelper.builder = MyCustomBuilder
|
||||
|
||||
# All formtastic forms have a class that indicates that they are just that. You
|
||||
# can change it to any class you want.
|
||||
# Formtastic::Helpers::FormHelper.default_form_class = 'formtastic'
|
||||
|
||||
# Formtastic will infer a class name from the model, array, string ot symbol you pass to the
|
||||
# form builder. You can customize the way that class is presented by overriding
|
||||
# this proc.
|
||||
# Formtastic::Helpers::FormHelper.default_form_model_class_proc = proc { |model_class_name| model_class_name }
|
||||
|
||||
# Allows to set a custom field_error_proc wrapper. By default this wrapper
|
||||
# is disabled since `formtastic` already adds an error class to the LI tag
|
||||
# containing the input.
|
||||
# Formtastic::Helpers::FormHelper.formtastic_field_error_proc = proc { |html_tag, instance_tag| html_tag }
|
||||
|
||||
# You can opt-in to Formtastic's use of the HTML5 `required` attribute on `<input>`, `<select>`
|
||||
# and `<textarea>` tags by setting this to true (defaults to false).
|
||||
# Formtastic::FormBuilder.use_required_attribute = false
|
||||
|
||||
# You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
|
||||
# this to true. Doing so will add a `novalidate` attribute to the `<form>` tag.
|
||||
# See http://diveintohtml5.org/forms.html#validation for more info.
|
||||
# Formtastic::FormBuilder.perform_browser_validations = true
|
||||
|
||||
# By creating custom input class finder, you can change how input classes are looked up.
|
||||
# For example you can make it to search for TextInputFilter instead of TextInput.
|
||||
# See # TODO: add link # for more information
|
||||
# NOTE: this behavior will be default from Formtastic 4.0
|
||||
Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
|
||||
|
||||
# Define custom namespaces in which to look up your Input classes. Default is
|
||||
# to look up in the global scope and in Formtastic::Inputs.
|
||||
# Formtastic::FormBuilder.input_namespaces = [ ::Object, ::MyInputsModule, ::Formtastic::Inputs ]
|
||||
|
||||
# By creating custom action class finder, you can change how action classes are looked up.
|
||||
# For example you can make it to search for MyButtonAction instead of ButtonAction.
|
||||
# See # TODO: add link # for more information
|
||||
# NOTE: this behavior will be default from Formtastic 4.0
|
||||
Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
|
||||
|
||||
# Define custom namespaces in which to look up your Action classes. Default is
|
||||
# to look up in the global scope and in Formtastic::Actions.
|
||||
# Formtastic::FormBuilder.action_namespaces = [ ::Object, ::MyActionsModule, ::Formtastic::Actions ]
|
|
@ -12,14 +12,6 @@ FactoryGirl.define do
|
|||
sequence(:name) { |n| "Category #{n}#{n}#{n}" }
|
||||
end
|
||||
|
||||
factory :mod_asset do
|
||||
image { File.new(Rails.root.join('spec', 'fixtures', 'test.jpg')) }
|
||||
end
|
||||
|
||||
factory :mod_video_asset, class: 'ModAsset' do
|
||||
video_url 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
end
|
||||
|
||||
factory :mod_version do
|
||||
number '3.5.4'
|
||||
released_at 3.weeks.ago
|
||||
|
|
|
@ -3,31 +3,31 @@ require 'rails_helper'
|
|||
RSpec.describe ModsHelper, :type => :helper do
|
||||
describe '#link_to_file_url_with_name' do
|
||||
it 'should return a link to the download URL if available' do
|
||||
file = build :mod_file, download_url: 'https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip', attachment: nil
|
||||
file = create :mod_file, download_url: 'https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip', attachment: nil
|
||||
expect(link_to_file_url_with_name(file))
|
||||
.to eq '<a href="https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip">v1.1.3-core.zip</a>'
|
||||
end
|
||||
|
||||
it 'should add a mirror if both are available' do
|
||||
file = build :mod_file, download_url: 'https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip'
|
||||
file = create :mod_file, download_url: 'https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip'
|
||||
expect(link_to_file_url_with_name(file))
|
||||
.to eq "<a href=\"https://github.com/Dysoch/DyTech/archive/v1.1.3-core.zip\">#{file.attachment_file_name}</a> (<a href=\"#{file.attachment.url}\">Mirror</a>)"
|
||||
end
|
||||
|
||||
it 'should return a link to the attachment URL if there is no download URL' do
|
||||
file = build :mod_file, download_url: nil
|
||||
file = create :mod_file, download_url: nil
|
||||
expect(link_to_file_url_with_name(file))
|
||||
.to eq "<a href=\"#{file.attachment.url}\">#{file.attachment_file_name} (#{number_to_human_size(file.attachment_file_size)})</a>"
|
||||
end
|
||||
|
||||
it 'should return a link to the attachment URL if the download URL is an empty string' do
|
||||
file = build :mod_file, download_url: ''
|
||||
file = create :mod_file, download_url: ''
|
||||
expect(link_to_file_url_with_name(file))
|
||||
.to eq "<a href=\"#{file.attachment.url}\">#{file.attachment_file_name} (#{number_to_human_size(file.attachment_file_size)})</a>"
|
||||
end
|
||||
|
||||
it 'should return nil with an invalid URI' do
|
||||
file = build :mod_file, download_url: 'http://github.com/javascript:alert("Yes")', attachment: nil
|
||||
file = create :mod_file, download_url: 'http://github.com/javascript:alert("Yes")', attachment: nil
|
||||
expect(link_to_file_url_with_name(file)).to eq nil
|
||||
end
|
||||
|
||||
|
|
|
@ -20,6 +20,6 @@ RSpec.describe Game, :type => :model do
|
|||
it 'should not allow to create more than one game' do
|
||||
create :game
|
||||
game = build :game
|
||||
expect{game.save}.to raise_error
|
||||
expect{game.save}.to raise_error Game::CannotCreateMoreThanOneGameError
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe ModAsset, :type => :model do
|
||||
def fixture_image
|
||||
File.new(Rails.root.join('spec', 'fixtures', 'test.jpg'))
|
||||
end
|
||||
|
||||
subject(:asset) { build :mod_asset }
|
||||
|
||||
describe 'attributes' do
|
||||
|
||||
describe '#image' do
|
||||
it { expect(asset).to respond_to :image }
|
||||
|
||||
it 'should be able to save an image with paperclip' do
|
||||
asset = build :mod_asset, image: fixture_image
|
||||
asset.save!
|
||||
end
|
||||
end
|
||||
|
||||
it { expect(asset).to respond_to :version }
|
||||
it { expect(asset).to respond_to :video_url }
|
||||
|
||||
describe '#video?' do
|
||||
it 'should be false when #video_url is blank' do
|
||||
asset.video_url = ''
|
||||
expect(asset.video?).to eq false
|
||||
end
|
||||
|
||||
it 'should be true when #video_url is not empty' do
|
||||
asset.video_url = 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
expect(asset.video?).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
describe '#video_provider' do
|
||||
it "should return :youtube when it's a YouTube video" do
|
||||
asset.video_url = 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
asset.video_provider.should eq :youtube
|
||||
end
|
||||
|
||||
it 'should return :unknown if no valid video provider identified' do
|
||||
asset.video_url = 'http://potato.com'
|
||||
asset.video_provider.should eq :unknown
|
||||
end
|
||||
end
|
||||
|
||||
describe '#video_embed_url' do
|
||||
it "should return the YouTube embed URL if it's a YouTube video" do
|
||||
asset.video_url = 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
expect(asset.video_embed_url).to eq 'http://www.youtube.com/embed/C0DPdy98e4c'
|
||||
end
|
||||
|
||||
it 'should return nil if not a valid video' do
|
||||
asset.video_url = 'http://potato.com'
|
||||
asset.video_embed_url.should eq nil
|
||||
end
|
||||
end
|
||||
|
||||
describe '#version_number' do
|
||||
it 'should delegate the version number to #version' do
|
||||
asset.version = build :mod_version, number: '1.5.7'
|
||||
asset.version_number.should eq '1.5.7'
|
||||
end
|
||||
end
|
||||
|
||||
describe '#sort_order' do
|
||||
it { expect(asset).to respond_to :sort_order }
|
||||
it { expect(asset.sort_order).to be_kind_of Integer }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'validation' do
|
||||
context 'empty image, empty video' do
|
||||
it 'should not be valid' do
|
||||
asset.image = nil
|
||||
asset.video_url = ''
|
||||
|
||||
expect(asset.valid?).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
context 'empty image, valid video' do
|
||||
it 'should be valid' do
|
||||
asset.image = nil
|
||||
asset.video_url = 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
|
||||
expect(asset.valid?).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
context 'valid image, empty video' do
|
||||
it 'should be valid' do
|
||||
asset.image = fixture_image
|
||||
asset.video_url = ''
|
||||
|
||||
expect(asset.valid?).to eq true
|
||||
end
|
||||
end
|
||||
|
||||
context 'valid image, valid video' do
|
||||
it 'should not be valid' do
|
||||
asset.image = fixture_image
|
||||
asset.video_url = 'http://www.youtube.com/watch?v=C0DPdy98e4c'
|
||||
|
||||
expect(asset.valid?).to eq false
|
||||
end
|
||||
end
|
||||
|
||||
context 'invalid video' do
|
||||
it 'should not be valid' do
|
||||
asset.image = nil
|
||||
asset.video_url = 'http://potato.com'
|
||||
|
||||
expect(asset.valid?).to eq false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue