trusty-cms 3.9.2 → 3.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +70 -57
- data/app/assets/javascripts/admin/assets_admin.js +0 -1
- data/app/assets/stylesheets/admin/main.scss +2 -2
- data/app/mailers/devise_mailer.rb +1 -1
- data/db/migrate/20200117141251_create_admin_users.rb +0 -5
- data/lib/trusty_cms.rb +1 -1
- data/spec/dummy/app/assets/config/manifest.js +0 -0
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/db/schema.rb +30 -0
- data/spec/features/config_spec.rb +19 -19
- data/spec/features/layouts_spec.rb +26 -26
- data/spec/features/pages_spec.rb +29 -29
- data/spec/fixtures/users.yml +9 -12
- data/spec/models/layout_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- data/trusty_cms.gemspec +2 -2
- metadata +8 -13
- data/app/assets/javascripts/admin/jquery.ui.widget.js +0 -558
- data/spec/controllers/welcome_controller_spec.rb +0 -6
- data/spec/features/admin_login_spec.rb +0 -92
- data/spec/routing/welcome_routing_spec.rb +0 -18
@@ -1,92 +0,0 @@
|
|
1
|
-
require 'rails_helper'
|
2
|
-
|
3
|
-
describe 'Administration Interface Login' do
|
4
|
-
fixtures :users
|
5
|
-
|
6
|
-
it 'shows a login page' do
|
7
|
-
visit '/'
|
8
|
-
|
9
|
-
expect(page).to have_field 'Username or E-mail Address'
|
10
|
-
expect(page).to have_field 'Password'
|
11
|
-
expect(page).to have_button 'Login'
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'shows an error if the username is wrong' do
|
15
|
-
log_in_as 'nonexistent_username'
|
16
|
-
|
17
|
-
expect(find('#error')).to have_content "Invalid username, e-mail address, or password."
|
18
|
-
end
|
19
|
-
|
20
|
-
describe 'as an admin user' do
|
21
|
-
before(:each) do
|
22
|
-
@admin = users(:captain_janeway)
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'after login' do
|
26
|
-
before(:each) do
|
27
|
-
log_in_as @admin.login
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'shows the admin interface' do
|
31
|
-
expect(page).to have_content "Logged in as"
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'has correct links in header' do
|
35
|
-
expect(page).to have_link @admin.name, href: '/admin/preferences/edit'
|
36
|
-
expect(page).to have_link 'Logout', href: '/admin/logout'
|
37
|
-
expect(page).to have_link 'View Site', href: '/'
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'has correct links in navigation' do
|
41
|
-
within '#navigation' do
|
42
|
-
expect(page).to have_link "Content", href: '/admin/pages'
|
43
|
-
expect(page).to have_link "Design", href: '/admin/layouts'
|
44
|
-
expect(page).to have_link "Settings", href: '/admin/configuration'
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
it 'outputs table header as html' do
|
49
|
-
expect(page).to have_selector "table#pages th.name"
|
50
|
-
end
|
51
|
-
|
52
|
-
|
53
|
-
it 'can navigate to create new page' do
|
54
|
-
visit '/admin/pages/new'
|
55
|
-
expect(page).to have_selector "h1", text: "New Page"
|
56
|
-
end
|
57
|
-
|
58
|
-
it 'can log out' do
|
59
|
-
click_link "Logout"
|
60
|
-
expect(page).to have_content "You are now logged out."
|
61
|
-
|
62
|
-
visit '/admin/pages/new'
|
63
|
-
expect(page).to have_content "Please Login"
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
it 'shows an error if the password is wrong' do
|
68
|
-
log_in_as @admin.login, 'passwordwhoops'
|
69
|
-
|
70
|
-
expect(find('#error')).to have_content "Invalid username, e-mail address, or password."
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
describe 'as a regular user after login' do
|
75
|
-
before(:each) do
|
76
|
-
@user = users(:neelix)
|
77
|
-
log_in_as @user.login
|
78
|
-
end
|
79
|
-
|
80
|
-
it 'can log in to the admin interface' do
|
81
|
-
expect(page).to have_content "Logged in as"
|
82
|
-
end
|
83
|
-
|
84
|
-
it 'has correct links in navigation' do
|
85
|
-
within '#navigation' do
|
86
|
-
expect(page).to have_link "Content", href: '/admin/pages'
|
87
|
-
expect(page).not_to have_link "Design"
|
88
|
-
expect(page).to have_link "Settings", href: '/admin/configuration'
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "rails_helper"
|
2
|
-
|
3
|
-
RSpec.describe "routes for Welcome", :type => :routing do
|
4
|
-
it "routes /admin/welcome to the admin/welcome controller" do
|
5
|
-
expect(get("/admin/welcome")).
|
6
|
-
to route_to("admin/welcome#index")
|
7
|
-
end
|
8
|
-
|
9
|
-
it "routes /admin/login to the admin/welcome controller" do
|
10
|
-
expect(get("/admin/login")).
|
11
|
-
to route_to("admin/welcome#login")
|
12
|
-
end
|
13
|
-
|
14
|
-
it "routes /admin/logout to the admin/welcome controller" do
|
15
|
-
expect(get("/admin/logout")).
|
16
|
-
to route_to("admin/welcome#logout")
|
17
|
-
end
|
18
|
-
end
|