Skip to content

Commit

Permalink
rails5 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
twalpole committed Jan 9, 2016
1 parent f322df2 commit ff99fae
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@
.config
.yardoc
Gemfile.lock
gemfiles/*.lock
InstalledFiles
_yardoc
coverage
Expand Down
4 changes: 4 additions & 0 deletions .rubocop.yml
@@ -1,3 +1,7 @@
AllCops:
Exclude:
- 'gemfiles/**/*'
- 'vendor/**/*'
Metrics/LineLength:
Max: 150 # TODO: we should decrease this to 120

Expand Down
6 changes: 6 additions & 0 deletions .travis.yml
Expand Up @@ -18,5 +18,11 @@ before_script:
- sh -e /etc/init.d/xvfb start

matrix:
include:
- rvm: 2.2.4
gemfile: gemfiles/Gemfile.rails-5.0-master
allow_failures:
- rvm: ruby-head
- rvm: 2.2.4
gemfile: gemfiles/Gemfile.rails-5.0-master

31 changes: 31 additions & 0 deletions gemfiles/Gemfile.rails-5.0-master
@@ -0,0 +1,31 @@
source "https://rubygems.org"

gemspec path: '..'

gem "webmock", "~> 1.20.4"
gem "bundler", "~> 1.6"
gem "rake"
gem "jquery-rails"
gem "capybara", github: 'jnicklas/capybara'
gem "pry"
gem "pry-byebug", platforms: [:mri]
gem "aws-sdk"
gem "rack-test", "~> 0.6.2"
gem "sqlite3", platforms: [:ruby]
gem "activerecord-jdbcsqlite3-adapter", platforms: [:jruby]
gem "poltergeist"
gem "yard"
gem "rubocop", "~>0.33.0"
gem "puma"
gem "mini_magick"
gem "simple_form"
gem "rails", github: "rails/rails"
gem "arel", github: "rails/arel"
gem "rack", github: "rack/rack"
gem "rspec-rails", github: "rspec/rspec-rails"
gem "rspec", github: "rspec/rspec"
gem "rspec-core", github: "rspec/rspec-core"
gem "rspec-support", github: "rspec/rspec-support"
gem "rspec-expectations", github: "rspec/rspec-expectations"
gem "rspec-mocks", github: "rspec/rspec-mocks"
gem "sinatra", github: "sinatra/sinatra", branch: "2.2.0-alpha"
2 changes: 1 addition & 1 deletion refile.gemspec
Expand Up @@ -15,6 +15,6 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = ">= 2.1.0"

spec.add_dependency "rest-client", "~> 1.8"
spec.add_dependency "sinatra", "~> 1.4.5"
spec.add_dependency "sinatra", ">= 1.4.5"
spec.add_dependency "mime-types"
end
4 changes: 1 addition & 3 deletions spec/refile/active_record_helper.rb
Expand Up @@ -32,6 +32,4 @@ def self.up
end
end

quietly do
TestMigration.up
end
TestMigration.up
6 changes: 3 additions & 3 deletions spec/refile/app_spec.rb
Expand Up @@ -4,7 +4,9 @@
include Rack::Test::Methods

def app
Refile::App.new
res = Refile::App.new
res.settings.set :public_folder, ""
res
end

before do
Expand All @@ -14,7 +16,6 @@ def app
describe "GET /:backend/:id/:filename" do
it "returns a stored file" do
file = Refile.store.upload(StringIO.new("hello"))

get "/token/store/#{file.id}/hello"

expect(last_response.status).to eq(200)
Expand All @@ -23,7 +24,6 @@ def app

it "sets appropriate content type from extension" do
file = Refile.store.upload(StringIO.new("hello"))

get "/token/store/#{file.id}/hello.html"

expect(last_response.status).to eq(200)
Expand Down
7 changes: 4 additions & 3 deletions spec/refile/attachment_helper_spec.rb
Expand Up @@ -40,11 +40,12 @@ def self.name

describe "#attachment_field" do
context "with index given" do
let(:html) { attachment_field("post", :document, object: klass.new, index: 0) }
let(:html) { Capybara.string(attachment_field("post", :document, object: klass.new, index: 0)) }

it "generates file and hidden inputs with identical names" do
expect(html).to include('name="post[0][document]" type="file"')
expect(html).to include('name="post[0][document]" type="hidden"')
field_name = "post[0][document]"
expect(html).to have_field(field_name, type: "file")
expect(html).to have_selector(:css, "input[name='#{field_name}'][type=hidden]", visible: false)
end
end
end
Expand Down

0 comments on commit ff99fae

Please sign in to comment.