Skip to content

[Don't merge] CI check #210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1b4e9ee
empty commit
nalabjp Nov 25, 2017
b777d1b
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
04d2b59
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
1004822
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
3ecb999
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
ac85ee8
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
1bdd95b
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
b1e4073
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
5d61ea7
Add a tag of RSpec as `scrivito: true` in order to skip test
nalabjp Nov 25, 2017
a2e4b10
Remove dependency on Scrivito
nalabjp Nov 25, 2017
0bfda54
Move Scrivito' workspace configuration to initialization
nalabjp Nov 25, 2017
fdc2474
Add conditions for Scrivito workspace configuration
nalabjp Nov 25, 2017
c753b18
Run the test excluding `scrivito` tag, if build from forked repo
nalabjp Nov 25, 2017
a79cb9e
Dummy configurations for Scrivito
nalabjp Nov 25, 2017
9890922
Stringify class name
nalabjp Nov 25, 2017
f989f65
Stringify class name
nalabjp Nov 25, 2017
bfb9c8c
Stringify class name
nalabjp Nov 25, 2017
0e17720
Revert "Dummy configurations for Scrivito"
nalabjp Nov 25, 2017
06d2a81
Simplify conditions for Scrivito workspace configuration
nalabjp Nov 25, 2017
66f961d
Remove useless an environment variable
nalabjp Nov 25, 2017
a7ff606
Workaround for described class
nalabjp Nov 25, 2017
93fbe3a
Workaround for described class
nalabjp Nov 25, 2017
3a10953
Workaround for described class
nalabjp Nov 25, 2017
57386bb
Move LoginPage creation to initialization
nalabjp Nov 25, 2017
c90ccc3
Revert "Workaround for described class"
nalabjp Nov 25, 2017
741456a
Revert "Workaround for described class"
nalabjp Nov 25, 2017
3d72002
Revert "Workaround for described class"
nalabjp Nov 25, 2017
543e824
Revert "Stringify class name"
nalabjp Nov 25, 2017
28ea8f7
Revert "Stringify class name"
nalabjp Nov 25, 2017
9663632
Revert "Stringify class name"
nalabjp Nov 25, 2017
3711877
Remove quotations
nalabjp Nov 25, 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
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ cache:
- bundler
script:
- bundle exec rake db:migrate --trace
- bundle exec rake
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bundle exec rspec spec; fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_PULL_REQUEST_SLUG" = "coderdojo-japan/coderdojo.jp" ]; then bundle exec rspec spec; fi
- if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_PULL_REQUEST_SLUG" != "coderdojo-japan/coderdojo.jp" ]; then bundle exec rspec spec --tag ~@scrivito; fi
env:
global:
- TZ='Asia/Tokyo'
6 changes: 0 additions & 6 deletions app/controllers/cms_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
class CmsController < ApplicationController
include Scrivito::ControllerActions

title ||= ENV['SCRIVITO_WORKSPACE'] || 'DEFAULT_WORKSPACE'
Scrivito::Workspace.create(title: title) unless Scrivito::Workspace.find_by_title(title)
Scrivito::Workspace.use(title)

LoginPage.create(title: 'ログイン')
end
2 changes: 1 addition & 1 deletion app/controllers/docs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def index

def show
@doc = Document.new(params[:id])
redirect_to scrivito_path(Obj.root) if not @doc.exists?
redirect_to root_url unless @doc.exists?
@content = Kramdown::Document.new(@doc.content, input: 'GFM').to_html
@url = request.url
end
Expand Down
8 changes: 8 additions & 0 deletions config/initializers/scrivito.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@
end
end
end

if ENV.key?('SCRIVITO_TENANT') && ENV.key?('SCRIVITO_API_KEY')
title ||= ENV['SCRIVITO_WORKSPACE'] || 'DEFAULT_WORKSPACE'
Scrivito::Workspace.create(title: title) unless Scrivito::Workspace.find_by_title(title)
Scrivito::Workspace.use(title)

LoginPage.create(title: 'ログイン')
end
2 changes: 1 addition & 1 deletion spec/controllers/blog_post_page_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe BlogPostPageController, type: :controller do
RSpec.describe BlogPostPageController, type: :controller, scrivito: true do
render_views

describe "GET Blog Post Page" do
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/docs_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

it 'when invalid filename' do
get :show, params: { id: '../not_found' }
expect(response).to redirect_to controller.scrivito_path(Obj.root)
expect(response).to redirect_to controller.root_url
expect(response.status).to eq 302
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/sessions_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe SessionsController, type: :controller do
RSpec.describe SessionsController, type: :controller, scrivito: true do
describe "GET #create" do
it "param match" do
get :create, params: { email: ENV['SCRIVITO_EMAIL'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe SotechshaOverviewPageController, type: :controller do
RSpec.describe SotechshaOverviewPageController, type: :controller, scrivito: true do
render_views

describe "GET #index" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/news_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require 'rails_helper'

RSpec.feature "News", type: :feature do
RSpec.feature "News", type: :feature, scrivito: true do
describe "GET /news/2016/12/12/new-backend" do
scenario "Title should be formatted" do
visit "/news/2016/12/12/new-backend"
Expand Down
2 changes: 1 addition & 1 deletion spec/features/sotechsha_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
require 'rails_helper'

RSpec.feature "Sotechsha", type: :feature, retry: 3 do
RSpec.feature "Sotechsha", type: :feature, scrivito: true, retry: 3 do

describe "GET /sotechsha/num" do
scenario "Quizzes should be permalink" do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/users_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'rails_helper'
include Scrivito::ControllerHelper

RSpec.feature "Users", type: :feature do
RSpec.feature "Users", type: :feature, scrivito: true do
subject { page }

describe "log in" do
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/news_pages_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe "NewsPages", type: :request do
RSpec.describe "NewsPages", type: :request, scrivito: true do
describe "GET /news/2016/12/12/new-backend" do
it "Blog post should be rendered" do
get '/news/2016/12/12/new-backend'
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/sotechshas_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'rails_helper'

RSpec.describe "Sotechshas", type: :request do
RSpec.describe "Sotechshas", type: :request, scrivito: true do

describe "Quizzes should be permalink" do
it "Quizzes should be permalink" do
Expand Down