Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c60e8b3
Remove Gemfile.lock from repository
fabn Oct 2, 2017
b93d975
Move development dependencies to Gemfile
fabn Oct 2, 2017
4856360
For now stick with rails 4.x.x
fabn Oct 2, 2017
54143b9
Use require_relative instead of plain require
fabn Oct 2, 2017
17981fb
Updated dependencies
fabn Oct 2, 2017
b6dec9d
Regenerated rspec files from scratch
fabn Oct 2, 2017
23bad81
Use new RSpec default with specs
fabn Oct 2, 2017
90c86f7
Removed dummy rails 3 app
fabn Oct 2, 2017
7468566
Moved dummy4 to dummy
fabn Oct 2, 2017
935d2d5
Generated database schema and migrations for dummy app
fabn Oct 2, 2017
915c4f1
Refactored RSpec configuration
fabn Oct 2, 2017
c98502d
Convert specs to RSpec 3.6.0 syntax with Transpec
fabn Oct 2, 2017
8be0d38
Fixed paths in rails helper
fabn Oct 2, 2017
2e09f80
Configured capybara driver
fabn Oct 2, 2017
5e91e58
Fix dummy application boot
fabn Oct 2, 2017
d43b1dc
Cleanup dummy application
fabn Oct 2, 2017
e42d910
Installed gems needed to boot the dummy application
fabn Oct 2, 2017
9842dfa
Working feature specs with latest capybara gem
fabn Oct 2, 2017
e67c0f1
VCR testing to avoid actual interactions with cloudinary remote api i…
fabn Oct 2, 2017
077222b
Travis configuration to automatically spec the project
fabn Oct 2, 2017
ba5d418
Install chrome driver before running specs
fabn Oct 2, 2017
40c29ff
Start browser in background before executing specs
fabn Oct 2, 2017
589fdb5
Regenerated mongoid configuration, since previous one wasn't working
fabn Oct 2, 2017
ed4f61e
Test mongoid using env variables in travis and disable features runni…
fabn Oct 2, 2017
1c19d8a
Restored localhost configuration for mongodb connection
fabn Oct 2, 2017
f500537
Cache bundler dependencies across builds
fabn Oct 2, 2017
855c128
Fixed mongoid version to avoid connections issues
fabn Oct 2, 2017
1315a68
Travis configuration with encrypted credentials and run all features
fabn Oct 3, 2017
f64ff80
Cleanup after specs
fabn Oct 3, 2017
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
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,11 @@ spec/dummy/.sass-cache
spec/dummy/config/cloudinary.yml
bin/

.rspec

config/cloudinary.yml

# Should not go into published repository
Gemfile.lock

# Failed rspec examples
spec/examples.txt
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require rails_helper
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: ruby
rvm:
- 2.3.3
# Cache bundler dependencies
cache: bundler
# For testing mongoid integration
services:
- mongodb
# Test both integrations
env:
- ATTACHINARY_ORM=active_record
- ATTACHINARY_ORM=mongoid
# Enable headless testing with chrome
dist: trusty
addons:
chrome: stable
# Headless test setup
before_install:
- # start your web application and listen on `localhost`
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
# Install ChromeDriver (64bits).
- wget -N http://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/bin
- sudo chmod +x /usr/local/bin/chromedriver
# Decrypt cloudinary credentials
before_script:
- openssl aes-256-cbc -K $encrypted_b867c800090e_key -iv $encrypted_b867c800090e_iv
-in cloudinary.yml.enc -out spec/dummy/config/cloudinary.yml -d
- bundle exec rake db:setup
# Run RSpec
script: bundle exec rake
# Cleanup cloudinary
after_script: bundle exec rake cleanup
33 changes: 28 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
source "http://rubygems.org"
source 'http://rubygems.org'

# Declare your gem's dependencies in attachinary.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
gemspec

# For now test on latest rails 4.2.x
gem 'rails', '~> 4.2.3'

# used by the dummy application
gem 'jquery-rails'
gem 'cloudinary'
gem 'simple_form'

group :assets do
gem 'coffee-rails'
# Assets gems used in dummy application
gem 'coffee-rails'
gem 'sass-rails'
gem 'bootstrap-sass', '~> 3.3.5'

source 'https://rails-assets.org' do
gem 'rails-assets-blueimp-file-upload', '7.2.1'
end

group :mongoid do
gem 'mongoid'
# Stick with a working configuration
gem 'mongoid', '~> 5.0'

group :development, :test do
gem 'pry'
gem 'sqlite3'
gem 'rspec-rails', '~> 3.5'
gem 'valid_attribute'
gem 'capybara', '>= 2.15.2'
gem 'capybara-screenshot'
gem 'selenium-webdriver'
gem 'factory_girl_rails'
gem 'launchy'
gem 'database_cleaner'
gem 'vcr'
gem 'webmock'
gem 'travis'
end


Expand Down
243 changes: 0 additions & 243 deletions Gemfile.lock

This file was deleted.

30 changes: 12 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,20 @@ load 'rails/tasks/engine.rake'

Bundler::GemHelper.install_tasks

#require 'rake/spectask'

# Spec::Rake::SpecTask.new(:spec) do |t|
# t.libs << 'lib'
# t.libs << 'spec'
# t.pattern = 'spec/**/*_spec.rb'
# t.verbose = false
# end

# Configure rspec rake task
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)


desc 'Run Devise tests for all ORMs.'
task :spec_all_orms do
Dir[File.join(File.dirname(__FILE__), 'spec', 'orm', '*.rb')].each do |file|
orm = File.basename(file).split(".").first
puts "\n\n-------- ORM: #{orm}\n\n"
exit 1 unless system "rake spec ATTACHINARY_ORM=#{orm}"
# Configure default task
task default: :spec

# Remove cloudinary files created during spec executions
task cleanup: :environment do
begin
print "Cleaning up created resources in cloud #{Cloudinary.config.cloud_name}..."
Cloudinary::Api.delete_resources_by_tag('test_env')
print ' (done)'
rescue Cloudinary::Api::RateLimited => e
print " (#{e.message})"
end
end

task :default => :spec_all_orms
Loading