trusty-cms 2.0.28 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,59 +0,0 @@
1
- require 'rails_helper'
2
-
3
- describe 'Editing using javascript features', js: true do
4
- fixtures :users
5
-
6
- before(:each) do
7
- @admin = users(:captain_janeway)
8
- log_in_as @admin.login
9
- end
10
-
11
- it 'edits all sorts of content' do
12
- # Create a new homepage
13
- click_link 'New Homepage'
14
- fill_in 'Page Title', with: 'Voyager Home'
15
- click_button 'Create Page'
16
-
17
- # Create a new child page of the home page
18
- # This is failing on Travis, but not on my box. Just trying to edit to push a new version.
19
- click_link 'Add Child'
20
- click_link 'Normal Page'
21
- fill_in 'Page Title', with: 'Command Center'
22
- page.execute_script("CKEDITOR.instances['part_body_content'].setData('You are on the bridge.');")
23
-
24
- # Add a custom page part
25
- click_link 'Add Part'
26
- fill_in 'Name', with: 'footer'
27
- click_button 'Add Part'
28
- expect(page).to have_selector '#tabs #tab_footer'
29
- page.execute_script("CKEDITOR.instances['part_footer_content'].setData('You are on the bridge.');")
30
-
31
- # Switch tabs
32
- click_link 'tab_body'
33
- result = evaluate_script("CKEDITOR.instances['part_body_content'].getData()")
34
- puts result
35
- result.should include("You are on the bridge.")
36
- expect(page).to_not have_field 'part_footer_content'
37
-
38
- # Remove a tab
39
- find('#tab_extended .close').click
40
- expect(page).to_not have_content 'extended'
41
-
42
- # Preview
43
- click_button 'Preview'
44
- within_frame 'page-preview' do
45
- expect(page).to have_content 'You are on the bridge.'
46
- expect(page).to_not have_content 'New Page'
47
- end
48
-
49
- # TODO: This is currently broken by treetable, but I don't understand how it works well enough to fix. Will consult carols10cents.
50
- # Save and check that all changes were saved
51
- #click_button 'Save Changes'
52
- #click_link 'Command Center'
53
- #expect(page).to_not have_content 'extended'
54
- #expect(page).to have_content 'footer'
55
- #expect(page).to have_field 'part_body_content', with: 'You are on the bridge.'
56
- #click_link 'tab_footer'
57
- #expect(page).to have_field 'part_footer_content', with: 'Copyright Voyager 2371'
58
- end
59
- end