1
0
mirror of https://github.com/danbee/danbarberphoto synced 2025-03-04 08:49:07 +00:00

Update Monban to Oath

This commit is contained in:
Daniel Barber 2018-02-14 22:12:14 -05:00
parent 53a0a6259c
commit e7733b8bf0
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
7 changed files with 48 additions and 54 deletions

View File

@ -39,7 +39,6 @@ end
group :test do
gem 'factory_girl_rails'
gem 'shoulda'
gem 'shoulda-context'
gem 'shoulda-matchers'
gem 'poltergeist'
gem 'database_cleaner'
@ -58,8 +57,8 @@ gem 'administrate-field-image'
gem 'dragonfly'
gem 'dragonfly-s3_data_store'
gem 'kaminari'
gem 'monban'
gem 'monban-generators'
gem 'oath'
gem 'oath-generators'
gem 'nokogiri'
gem 'pg'
gem 'kramdown'

View File

@ -180,16 +180,16 @@ GEM
minitest (5.11.3)
momentjs-rails (2.17.1)
railties (>= 3.1)
monban (1.1.1)
bcrypt
rails
warden
monban-generators (1.0.1)
monban (>= 0.0.12)
multi_json (1.13.1)
nio4r (2.2.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
oath (1.1.0)
bcrypt
rails
warden
oath-generators (1.0.1)
oath (>= 0.0.12)
parallel (1.12.1)
parser (2.4.0.2)
ast (~> 2.3)
@ -351,9 +351,9 @@ DEPENDENCIES
kaminari
kramdown
letter_opener
monban
monban-generators
nokogiri
oath
oath-generators
pg
poltergeist
powder
@ -367,7 +367,6 @@ DEPENDENCIES
ruby_parser
sass-rails
shoulda
shoulda-context
shoulda-matchers
simple_form
simplecov
@ -379,4 +378,4 @@ RUBY VERSION
ruby 2.4.2p198
BUNDLED WITH
1.16.0
1.16.1

View File

@ -6,7 +6,7 @@
# you're free to overwrite the RESTful controller actions.
module Admin
class ApplicationController < Administrate::ApplicationController
include Monban::ControllerHelpers
include Oath::ControllerHelpers
before_action :require_login

View File

@ -1,5 +1,5 @@
class ApplicationController < ActionController::Base
include Monban::ControllerHelpers
include Oath::ControllerHelpers
protect_from_forgery
rescue_from ActiveRecord::RecordNotFound, with: :render_404

View File

@ -1,5 +1,5 @@
require 'monban/constraints/signed_in'
require 'monban/constraints/signed_out'
require 'oath/constraints/signed_in'
require 'oath/constraints/signed_out'
DanBarberPhoto::Application.routes.draw do
namespace :admin do

View File

@ -1,4 +1,3 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
@ -17,63 +16,60 @@ ActiveRecord::Schema.define(version: 20151028124718) do
enable_extension "plpgsql"
create_table "categories", force: :cascade do |t|
t.string "name", limit: 255
t.text "description"
t.string "name", limit: 255
t.text "description"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "photo_id"
t.string "base_colour", limit: 255
t.integer "sort"
t.string "slug", limit: 255
t.integer "photo_id"
t.string "base_colour", limit: 255
t.integer "sort"
t.string "slug", limit: 255
end
create_table "categories_photos", id: false, force: :cascade do |t|
t.integer "category_id"
t.integer "photo_id"
t.index ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true
end
add_index "categories_photos", ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true, using: :btree
create_table "pages", force: :cascade do |t|
t.string "name", limit: 255
t.string "title", limit: 255
t.text "content"
t.string "name", limit: 255
t.string "title", limit: 255
t.text "content"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "photos", force: :cascade do |t|
t.string "flickr_url", limit: 255
t.string "flickr_url", limit: 255
t.datetime "created_at"
t.datetime "updated_at"
t.string "title", limit: 255
t.text "description"
t.integer "sort"
t.boolean "featured", default: false
t.boolean "enabled", default: true
t.string "title", limit: 255
t.text "description"
t.integer "sort"
t.boolean "featured", default: false
t.boolean "enabled", default: true
t.datetime "taken_at"
t.integer "views", default: 0
t.string "image_uid", limit: 255
t.string "image_name", limit: 255
t.integer "views", default: 0
t.string "image_uid", limit: 255
t.string "image_name", limit: 255
end
create_table "sessions", force: :cascade do |t|
t.string "session_id", limit: 255, null: false
t.text "data"
t.string "session_id", limit: 255, null: false
t.text "data"
t.datetime "created_at"
t.datetime "updated_at"
t.index ["session_id"], name: "index_sessions_on_session_id"
t.index ["updated_at"], name: "index_sessions_on_updated_at"
end
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
create_table "users", force: :cascade do |t|
t.string "email", null: false
t.string "password_digest", limit: 60, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "email", null: false
t.string "password_digest", limit: 60, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["email"], name: "index_users_on_email", unique: true
end
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
end

View File

@ -1,12 +1,12 @@
require "spec_helper"
describe Contact do
it { should validate_presence_of(:email) }
it { should validate_presence_of(:name) }
it { should validate_presence_of(:message) }
it { is_expected.to validate_presence_of(:email) }
it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_presence_of(:message) }
it { should allow_value("test@test.com").for(:email) }
it { should_not allow_value("test@test").for(:email) }
it { is_expected.to allow_value('test@test.com').for(:email) }
it { is_expected.not_to allow_value('test@test').for(:email) }
let(:contact) { build(:contact) }
end