mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Update to Rails 5.1 and remove Typekit
This commit is contained in:
parent
c9109312c9
commit
a76a46545d
6
Gemfile
6
Gemfile
@ -3,7 +3,7 @@ ruby '2.4.1'
|
|||||||
|
|
||||||
gem 'dotenv-rails', :groups => [:development, :test]
|
gem 'dotenv-rails', :groups => [:development, :test]
|
||||||
|
|
||||||
gem 'rails', '~> 4.2.0'
|
gem 'rails', '~> 5.1'
|
||||||
|
|
||||||
# Bundle edge Rails instead:
|
# Bundle edge Rails instead:
|
||||||
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
||||||
@ -31,6 +31,7 @@ end
|
|||||||
|
|
||||||
group :test, :development do
|
group :test, :development do
|
||||||
gem 'rspec-rails'
|
gem 'rspec-rails'
|
||||||
|
gem 'rails-controller-testing'
|
||||||
gem 'rubocop'
|
gem 'rubocop'
|
||||||
gem 'pry'
|
gem 'pry'
|
||||||
end
|
end
|
||||||
@ -59,10 +60,9 @@ gem 'dragonfly-s3_data_store'
|
|||||||
gem 'kaminari'
|
gem 'kaminari'
|
||||||
gem 'monban'
|
gem 'monban'
|
||||||
gem 'monban-generators'
|
gem 'monban-generators'
|
||||||
gem 'nokogiri', '~> 1.6.8.rc3'
|
gem 'nokogiri'
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
gem 'kramdown'
|
gem 'kramdown'
|
||||||
gem 'simple_form'
|
gem 'simple_form'
|
||||||
gem 'slugtastic'
|
gem 'slugtastic'
|
||||||
gem 'squeel'
|
|
||||||
gem 'unf'
|
gem 'unf'
|
||||||
|
|||||||
122
Gemfile.lock
122
Gemfile.lock
@ -1,39 +1,42 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: http://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.2.9)
|
actioncable (5.1.2)
|
||||||
actionpack (= 4.2.9)
|
actionpack (= 5.1.2)
|
||||||
actionview (= 4.2.9)
|
nio4r (~> 2.0)
|
||||||
activejob (= 4.2.9)
|
websocket-driver (~> 0.6.1)
|
||||||
|
actionmailer (5.1.2)
|
||||||
|
actionpack (= 5.1.2)
|
||||||
|
actionview (= 5.1.2)
|
||||||
|
activejob (= 5.1.2)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (4.2.9)
|
actionpack (5.1.2)
|
||||||
actionview (= 4.2.9)
|
actionview (= 5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
rack (~> 1.6)
|
rack (~> 2.0)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.3)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
actionview (4.2.9)
|
actionview (5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubis (~> 2.7.0)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||||
activejob (4.2.9)
|
activejob (5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.6)
|
||||||
activemodel (4.2.9)
|
activemodel (5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
builder (~> 3.1)
|
activerecord (5.1.2)
|
||||||
activerecord (4.2.9)
|
activemodel (= 5.1.2)
|
||||||
activemodel (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
activesupport (= 4.2.9)
|
arel (~> 8.0)
|
||||||
arel (~> 6.0)
|
activesupport (5.1.2)
|
||||||
activesupport (4.2.9)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (~> 0.7)
|
i18n (~> 0.7)
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.3, >= 0.3.4)
|
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
addressable (2.5.1)
|
addressable (2.5.1)
|
||||||
public_suffix (~> 2.0, >= 2.0.2)
|
public_suffix (~> 2.0, >= 2.0.2)
|
||||||
@ -50,7 +53,7 @@ GEM
|
|||||||
selectize-rails (~> 0.6)
|
selectize-rails (~> 0.6)
|
||||||
administrate-field-image (1.1.0)
|
administrate-field-image (1.1.0)
|
||||||
administrate (>= 0.2.0.rc1)
|
administrate (>= 0.2.0.rc1)
|
||||||
arel (6.0.4)
|
arel (8.0.0)
|
||||||
ast (2.3.0)
|
ast (2.3.0)
|
||||||
autoprefixer-rails (7.1.2.3)
|
autoprefixer-rails (7.1.2.3)
|
||||||
execjs
|
execjs
|
||||||
@ -110,6 +113,7 @@ GEM
|
|||||||
dragonfly-s3_data_store (1.3.0)
|
dragonfly-s3_data_store (1.3.0)
|
||||||
dragonfly (~> 1.0)
|
dragonfly (~> 1.0)
|
||||||
fog-aws
|
fog-aws
|
||||||
|
erubi (1.6.1)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
excon (0.57.1)
|
excon (0.57.1)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
@ -171,7 +175,7 @@ GEM
|
|||||||
mime-types (3.1)
|
mime-types (3.1)
|
||||||
mime-types-data (~> 3.2015)
|
mime-types-data (~> 3.2015)
|
||||||
mime-types-data (3.2016.0521)
|
mime-types-data (3.2016.0521)
|
||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.2.0)
|
||||||
minitest (5.10.2)
|
minitest (5.10.2)
|
||||||
momentjs-rails (2.17.1)
|
momentjs-rails (2.17.1)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
@ -182,8 +186,9 @@ GEM
|
|||||||
monban-generators (1.0.0)
|
monban-generators (1.0.0)
|
||||||
monban (>= 0.0.12)
|
monban (>= 0.0.12)
|
||||||
multi_json (1.12.1)
|
multi_json (1.12.1)
|
||||||
nokogiri (1.6.8.1)
|
nio4r (2.1.0)
|
||||||
mini_portile2 (~> 2.1.0)
|
nokogiri (1.8.0)
|
||||||
|
mini_portile2 (~> 2.2.0)
|
||||||
parallel (1.11.2)
|
parallel (1.11.2)
|
||||||
parser (2.4.0.0)
|
parser (2.4.0.0)
|
||||||
ast (~> 2.2)
|
ast (~> 2.2)
|
||||||
@ -192,8 +197,6 @@ GEM
|
|||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
polyamorous (1.1.0)
|
|
||||||
activerecord (>= 3.0)
|
|
||||||
powder (0.3.2)
|
powder (0.3.2)
|
||||||
thor (>= 0.11.5)
|
thor (>= 0.11.5)
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
@ -203,26 +206,28 @@ GEM
|
|||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
public_suffix (2.0.5)
|
public_suffix (2.0.5)
|
||||||
puma (3.9.1)
|
puma (3.9.1)
|
||||||
rack (1.6.8)
|
rack (2.0.3)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.2.9)
|
rails (5.1.2)
|
||||||
actionmailer (= 4.2.9)
|
actioncable (= 5.1.2)
|
||||||
actionpack (= 4.2.9)
|
actionmailer (= 5.1.2)
|
||||||
actionview (= 4.2.9)
|
actionpack (= 5.1.2)
|
||||||
activejob (= 4.2.9)
|
actionview (= 5.1.2)
|
||||||
activemodel (= 4.2.9)
|
activejob (= 5.1.2)
|
||||||
activerecord (= 4.2.9)
|
activemodel (= 5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activerecord (= 5.1.2)
|
||||||
|
activesupport (= 5.1.2)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.2.9)
|
railties (= 5.1.2)
|
||||||
sprockets-rails
|
sprockets-rails (>= 2.0.0)
|
||||||
rails-deprecated_sanitizer (1.0.3)
|
rails-controller-testing (1.0.2)
|
||||||
activesupport (>= 4.2.0.alpha)
|
actionpack (~> 5.x, >= 5.0.1)
|
||||||
rails-dom-testing (1.0.8)
|
actionview (~> 5.x, >= 5.0.1)
|
||||||
activesupport (>= 4.2.0.beta, < 5.0)
|
activesupport (~> 5.x)
|
||||||
nokogiri (~> 1.6)
|
rails-dom-testing (2.0.3)
|
||||||
rails-deprecated_sanitizer (>= 1.0.1)
|
activesupport (>= 4.2.0)
|
||||||
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.0.3)
|
rails-html-sanitizer (1.0.3)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
rails_12factor (0.0.3)
|
rails_12factor (0.0.3)
|
||||||
@ -230,9 +235,10 @@ GEM
|
|||||||
rails_stdout_logging
|
rails_stdout_logging
|
||||||
rails_serve_static_assets (0.0.5)
|
rails_serve_static_assets (0.0.5)
|
||||||
rails_stdout_logging (0.0.5)
|
rails_stdout_logging (0.0.5)
|
||||||
railties (4.2.9)
|
railties (5.1.2)
|
||||||
actionpack (= 4.2.9)
|
actionpack (= 5.1.2)
|
||||||
activesupport (= 4.2.9)
|
activesupport (= 5.1.2)
|
||||||
|
method_source
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.2.2)
|
rainbow (2.2.2)
|
||||||
@ -304,10 +310,6 @@ GEM
|
|||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
squeel (1.2.3)
|
|
||||||
activerecord (>= 3.0)
|
|
||||||
activesupport (>= 3.0)
|
|
||||||
polyamorous (~> 1.1.0)
|
|
||||||
thor (0.19.4)
|
thor (0.19.4)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.7)
|
tilt (2.0.7)
|
||||||
@ -351,13 +353,14 @@ DEPENDENCIES
|
|||||||
letter_opener
|
letter_opener
|
||||||
monban
|
monban
|
||||||
monban-generators
|
monban-generators
|
||||||
nokogiri (~> 1.6.8.rc3)
|
nokogiri
|
||||||
pg
|
pg
|
||||||
poltergeist
|
poltergeist
|
||||||
powder
|
powder
|
||||||
pry
|
pry
|
||||||
puma
|
puma
|
||||||
rails (~> 4.2.0)
|
rails (~> 5.1)
|
||||||
|
rails-controller-testing
|
||||||
rails_12factor
|
rails_12factor
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rubocop
|
rubocop
|
||||||
@ -369,7 +372,6 @@ DEPENDENCIES
|
|||||||
simple_form
|
simple_form
|
||||||
simplecov
|
simplecov
|
||||||
slugtastic
|
slugtastic
|
||||||
squeel
|
|
||||||
uglifier
|
uglifier
|
||||||
unf
|
unf
|
||||||
|
|
||||||
|
|||||||
@ -17,13 +17,13 @@ class PhotosController < ApplicationController
|
|||||||
|
|
||||||
def for_category(category_id)
|
def for_category(category_id)
|
||||||
@category = Category.find_by_id(category_id)
|
@category = Category.find_by_id(category_id)
|
||||||
@photos = @category.photos.enabled.order { taken_at.desc }
|
@photos = @category.photos.enabled.order(taken_at: :desc)
|
||||||
.page(params[:page])
|
.page(params[:page])
|
||||||
@page_title = @category.name
|
@page_title = @category.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def all
|
def all
|
||||||
@photos = Photo.enabled.order { taken_at.desc }
|
@photos = Photo.enabled.order(taken_at: :desc)
|
||||||
.page(params[:page])
|
.page(params[:page])
|
||||||
@page_title = 'All Photos'
|
@page_title = 'All Photos'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -10,7 +10,6 @@
|
|||||||
<%= stylesheet_link_tag 'application' %>
|
<%= stylesheet_link_tag 'application' %>
|
||||||
<%= javascript_include_tag 'application' %>
|
<%= javascript_include_tag 'application' %>
|
||||||
<%= favicon_link_tag 'favicon.ico' %>
|
<%= favicon_link_tag 'favicon.ico' %>
|
||||||
<%= render 'shared/typekit' %>
|
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@ -9,9 +9,11 @@ describe ContactsController, type: :controller do
|
|||||||
end
|
end
|
||||||
|
|
||||||
let(:contact_params) do
|
let(:contact_params) do
|
||||||
{ name: 'Dan Barber',
|
{
|
||||||
|
name: 'Dan Barber',
|
||||||
email: 'danbee@gmail.com',
|
email: 'danbee@gmail.com',
|
||||||
message: 'This is a message.' }
|
message: 'This is a message.',
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST create' do
|
describe 'POST create' do
|
||||||
@ -19,7 +21,7 @@ describe ContactsController, type: :controller do
|
|||||||
valid_contact = double(valid?: true)
|
valid_contact = double(valid?: true)
|
||||||
allow(Contact).to receive(:new).and_return(valid_contact)
|
allow(Contact).to receive(:new).and_return(valid_contact)
|
||||||
allow(Notifier).to receive(:contact_notification).and_return(double(deliver: true))
|
allow(Notifier).to receive(:contact_notification).and_return(double(deliver: true))
|
||||||
post :create, contact: contact_params
|
post :create, params: { contact: contact_params }
|
||||||
|
|
||||||
expect(Notifier).to have_received(:contact_notification).with(valid_contact)
|
expect(Notifier).to have_received(:contact_notification).with(valid_contact)
|
||||||
expect(flash[:notice]).to eql(I18n.t('contact.thanks'))
|
expect(flash[:notice]).to eql(I18n.t('contact.thanks'))
|
||||||
@ -28,7 +30,7 @@ describe ContactsController, type: :controller do
|
|||||||
|
|
||||||
it 're-renders the form if params are missing' do
|
it 're-renders the form if params are missing' do
|
||||||
allow(Contact).to receive(:new).and_return(double(valid?: false))
|
allow(Contact).to receive(:new).and_return(double(valid?: false))
|
||||||
post :create, contact: {}
|
post :create, params: { contact: {} }
|
||||||
expect(flash[:alert]).to eql(I18n.t('contact.invalid'))
|
expect(flash[:alert]).to eql(I18n.t('contact.invalid'))
|
||||||
expect(response).to render_template(:new)
|
expect(response).to render_template(:new)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -5,12 +5,12 @@ describe PagesController, type: :controller do
|
|||||||
let(:test_page) { create(:page) }
|
let(:test_page) { create(:page) }
|
||||||
|
|
||||||
it 'renders a page' do
|
it 'renders a page' do
|
||||||
get :show, name: test_page.name
|
get :show, params: { name: test_page.name }
|
||||||
expect(response).to render_template(:show)
|
expect(response).to render_template(:show)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders 404 for a non existant page' do
|
it 'renders 404 for a non existant page' do
|
||||||
get :show, name: 'not-a-page'
|
get :show, params: { name: 'not-a-page' }
|
||||||
expect(response.status).to eql(404)
|
expect(response.status).to eql(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -6,12 +6,12 @@ RSpec.describe ViewsController, type: :controller do
|
|||||||
|
|
||||||
it 'logs a photo view' do
|
it 'logs a photo view' do
|
||||||
expect_any_instance_of(Photo).to receive(:log_view).once
|
expect_any_instance_of(Photo).to receive(:log_view).once
|
||||||
post :create, photo_id: photo.id
|
post :create, params: { photo_id: photo.id }
|
||||||
expect(response).to be_successful
|
expect(response).to be_successful
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'responds with not_found if the photo is not present' do
|
it 'responds with not_found if the photo is not present' do
|
||||||
post :create, photo_id: 999
|
post :create, params: { photo_id: 999 }
|
||||||
expect(response.status).to eql(404)
|
expect(response.status).to eql(404)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user