mercury-rails 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/app/assets/images/mercury/toolbar/{snippetable → snippets}/buttons.png +0 -0
  2. data/app/assets/javascripts/mercury.js +58 -84
  3. data/app/assets/javascripts/mercury/lightview.js.coffee +1 -1
  4. data/app/assets/javascripts/mercury/mercury.js.coffee +1 -1
  5. data/app/assets/javascripts/mercury/modal.js.coffee +1 -1
  6. data/app/assets/javascripts/mercury/modals/insertmedia.js.coffee +13 -9
  7. data/app/assets/javascripts/mercury/native_extensions.js.coffee +0 -6
  8. data/app/assets/javascripts/mercury/page_editor.js.coffee +19 -19
  9. data/app/assets/javascripts/mercury/region.js.coffee +11 -10
  10. data/app/assets/javascripts/mercury/regions/{editable.js.coffee → full.coffee} +18 -18
  11. data/app/assets/javascripts/mercury/regions/image.js.coffee +13 -34
  12. data/app/assets/javascripts/mercury/regions/{markupable.js.coffee → markdown.coffee} +21 -22
  13. data/app/assets/javascripts/mercury/regions/simple.js.coffee +10 -39
  14. data/app/assets/javascripts/mercury/regions/{snippetable.js.coffee → snippets.js.coffee} +8 -7
  15. data/app/assets/javascripts/mercury/snippet.js.coffee +1 -1
  16. data/app/assets/javascripts/mercury/snippet_toolbar.js.coffee +3 -2
  17. data/app/assets/javascripts/mercury/toolbar.button.js.coffee +2 -2
  18. data/app/assets/javascripts/mercury/toolbar.button_group.js.coffee +2 -2
  19. data/app/assets/javascripts/mercury/toolbar.js.coffee +2 -2
  20. data/app/assets/javascripts/mercury/uploader.js.coffee +2 -1
  21. data/app/assets/stylesheets/mercury/all_images.css.erb +2 -2
  22. data/app/assets/stylesheets/mercury/dialog.css +2 -2
  23. data/app/assets/stylesheets/mercury/lightview.css +14 -14
  24. data/app/assets/stylesheets/mercury/modal.css +1 -1
  25. data/app/assets/stylesheets/mercury/toolbar.css +1 -1
  26. data/features/generators/install.feature +1 -1
  27. data/features/loading/loading.feature +2 -2
  28. data/features/regions/{editable → full}/advanced_editing.feature +0 -0
  29. data/features/regions/full/basic_editing.feature +196 -0
  30. data/features/regions/{editable → full}/inserting_links.feature +12 -12
  31. data/features/regions/{editable → full}/inserting_media.feature +15 -15
  32. data/features/regions/{editable → full}/inserting_snippets.feature +15 -15
  33. data/features/regions/{editable → full}/inserting_special_characters.feature +2 -2
  34. data/features/regions/full/inserting_tables.feature +109 -0
  35. data/features/regions/{editable → full}/pasting.feature +0 -0
  36. data/features/regions/{editable → full}/uploading_images.feature +0 -0
  37. data/features/regions/{markupable → markdown}/advanced_editing.feature +0 -0
  38. data/features/regions/{markupable → markdown}/basic_editing.feature +0 -0
  39. data/features/regions/{markupable → markdown}/inserting_links.feature +0 -0
  40. data/features/regions/{markupable → markdown}/inserting_media.feature +0 -0
  41. data/features/regions/{markupable → markdown}/inserting_snippets.feature +0 -0
  42. data/features/regions/{markupable → markdown}/inserting_special_characters.feature +0 -0
  43. data/features/regions/{markupable → markdown}/inserting_tables.feature +0 -0
  44. data/features/regions/{markupable → markdown}/uploading_images.feature +0 -0
  45. data/features/regions/{snippetable → snippets}/advanced_editing.feature +0 -0
  46. data/features/regions/{snippetable → snippets}/basic_editing.feature +0 -0
  47. data/features/regions/{snippetable → snippets}/inserting_snippets.feature +0 -0
  48. data/features/saving/saving.feature +8 -8
  49. data/features/step_definitions/mercury_steps.rb +13 -13
  50. data/features/support/mercury_selectors.rb +3 -3
  51. data/lib/generators/mercury/install/images/images_generator.rb +3 -0
  52. data/lib/generators/mercury/install/install_generator.rb +5 -5
  53. data/lib/mercury/version.rb +1 -1
  54. data/spec/dummy/app/assets/javascripts/application.js +0 -15
  55. data/spec/dummy/{public → app/assets/javascripts}/prototype.js +0 -0
  56. data/spec/dummy/app/assets/stylesheets/application.css.scss +110 -0
  57. data/spec/dummy/public/frame.html +1 -1
  58. data/spec/dummy/public/index.html +92 -216
  59. data/spec/javascripts/mercury/lightview_spec.js.coffee +1 -1
  60. data/spec/javascripts/mercury/modal_spec.js.coffee +1 -1
  61. data/spec/javascripts/mercury/modals/insertmedia_spec.js.coffee +41 -2
  62. data/spec/javascripts/mercury/page_editor_spec.js.coffee +19 -18
  63. data/spec/javascripts/mercury/region_spec.js.coffee +12 -14
  64. data/spec/javascripts/mercury/regions/{editable_spec.js.coffee → full_spec.js.coffee} +16 -16
  65. data/spec/javascripts/mercury/regions/image_spec.js.coffee +3 -3
  66. data/spec/javascripts/mercury/regions/{markupable_spec.js.coffee → markdown_spec.js.coffee} +18 -18
  67. data/spec/javascripts/mercury/regions/simple_spec.js.coffee +3 -3
  68. data/spec/javascripts/mercury/regions/{snippetable_spec.js.coffee → snippets_spec.js.coffee} +53 -53
  69. data/spec/javascripts/mercury/snippet_spec.js.coffee +1 -1
  70. data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -2
  71. data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +5 -5
  72. data/spec/javascripts/mercury/toolbar.button_spec.js.coffee +6 -6
  73. data/spec/javascripts/mercury/toolbar_spec.js.coffee +4 -4
  74. data/spec/javascripts/mercury/uploader_spec.js.coffee +5 -5
  75. data/spec/javascripts/templates/mercury/page_editor.html +4 -4
  76. data/spec/javascripts/templates/mercury/region.html +1 -1
  77. data/spec/javascripts/templates/mercury/regions/full.html +1 -0
  78. data/spec/javascripts/templates/mercury/regions/image.html +1 -1
  79. data/spec/javascripts/templates/mercury/regions/markdown.html +1 -0
  80. data/spec/javascripts/templates/mercury/regions/simple.html +1 -3
  81. data/spec/javascripts/templates/mercury/regions/snippets.html +4 -0
  82. metadata +65 -75
  83. data/app/assets/javascripts/mercury_loader.js +0 -193
  84. data/app/assets/javascripts/mercury_overrides.js +0 -6
  85. data/app/assets/stylesheets/mercury_overrides.css +0 -17
  86. data/features/regions/editable/basic_editing.feature +0 -196
  87. data/features/regions/editable/inserting_tables.feature +0 -109
  88. data/spec/dummy/app/assets/stylesheets/application.css +0 -13
  89. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  90. data/spec/dummy/public/404.html +0 -26
  91. data/spec/dummy/public/422.html +0 -26
  92. data/spec/dummy/public/canvastest.html +0 -103
  93. data/spec/javascripts/templates/mercury/regions/editable.html +0 -3
  94. data/spec/javascripts/templates/mercury/regions/snippetable.html +0 -4
@@ -12,7 +12,7 @@ Feature:
12
12
 
13
13
 
14
14
  Scenario: A user can insert and edit a link to an external site
15
- Given the content of the editable region is simple content
15
+ Given the content of the full region is simple content
16
16
  And I make a selection
17
17
 
18
18
  When I click on the "Insert Link" button
@@ -21,7 +21,7 @@ Feature:
21
21
 
22
22
  When I fill in "URL" with "http://google.com"
23
23
  And press "Insert Link"
24
- Then the contents of the editable region should be "this is <a href='http://google.com'>simple</a> <b>content</b>"
24
+ Then the contents of the full region should be "this is <a href='http://google.com'>simple</a> <b>content</b>"
25
25
  And the modal window should not be visible
26
26
 
27
27
  When I click on the "Insert Link" button
@@ -29,27 +29,27 @@ Feature:
29
29
 
30
30
  When I fill in "URL" with "http://cnn.com"
31
31
  And press "Insert Link"
32
- Then the contents of the editable region should be "this is <a href='http://cnn.com'>simple</a> <b>content</b>"
32
+ Then the contents of the full region should be "this is <a href='http://cnn.com'>simple</a> <b>content</b>"
33
33
 
34
34
 
35
35
  Scenario: A user can insert and edit a link with a target set
36
- Given the content of the editable region is simple content
36
+ Given the content of the full region is simple content
37
37
  And I make a selection
38
38
 
39
39
  When I click on the "Insert Link" button
40
40
  And fill in "URL" with "http://google.com"
41
41
  And select "Blank (a new window or tab)" from "Link Target"
42
42
  And press "Insert Link"
43
- Then the contents of the editable region should be "this is <a target='_blank' href='http://google.com'>simple</a> <b>content</b>"
43
+ Then the contents of the full region should be "this is <a target='_blank' href='http://google.com'>simple</a> <b>content</b>"
44
44
 
45
45
  When I click on the "Insert Link" button
46
46
  And select "Top (removes any frames)" from "Link Target"
47
47
  And press "Insert Link"
48
- Then the contents of the editable region should be "this is <a target='_top' href='http://google.com'>simple</a> <b>content</b>"
48
+ Then the contents of the full region should be "this is <a target='_top' href='http://google.com'>simple</a> <b>content</b>"
49
49
 
50
50
 
51
51
  Scenario: A user can insert a link to an external site and open it in a popup
52
- Given the content of the editable region is simple content
52
+ Given the content of the full region is simple content
53
53
  And I make a selection
54
54
 
55
55
  When I click on the "Insert Link" button
@@ -58,7 +58,7 @@ Feature:
58
58
  And I fill in "Popup Width" with "500"
59
59
  And fill in "Popup Height" with "200"
60
60
  And press "Insert Link"
61
- Then the contents of the editable region should be "this is <a href='javascript:void(window.open('http://google.com', 'popup_window', 'width=500,height=200,menubar=no,toolbar=no'))'>simple</a> <b>content</b>"
61
+ Then the contents of the full region should be "this is <a href='javascript:void(window.open('http://google.com', 'popup_window', 'width=500,height=200,menubar=no,toolbar=no'))'>simple</a> <b>content</b>"
62
62
 
63
63
  When I click on the "Insert Link" button
64
64
  Then the "Popup Width" field should contain "500"
@@ -66,21 +66,21 @@ Feature:
66
66
 
67
67
 
68
68
  Scenario: A user can insert a bookmark and then link to it
69
- Given the content of the editable region is simple content
69
+ Given the content of the full region is simple content
70
70
  And I make a selection
71
71
 
72
72
  When I click on the "Insert Link" button
73
73
  And I choose "Bookmark"
74
74
  And fill in "Bookmark" with "test-bookmark1"
75
75
  And press "Insert Link"
76
- Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <b>content</b>"
76
+ Then the contents of the full region should be "this is <a name='test-bookmark1'>simple</a> <b>content</b>"
77
77
 
78
78
  When I make a selection for "b"
79
79
  And click on the "Insert Link" button
80
80
  And I choose "Existing Links"
81
81
  And select "simple" from "Existing Links"
82
82
  And press "Insert Link"
83
- Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <a href='#test-bookmark1'>content</a>"
83
+ Then the contents of the full region should be "this is <a name='test-bookmark1'>simple</a> <a href='#test-bookmark1'>content</a>"
84
84
 
85
85
  When I make a selection for "a"
86
86
  And click on the "Insert Link" button
@@ -89,7 +89,7 @@ Feature:
89
89
  And I choose "Bookmark"
90
90
  And fill in "Bookmark" with "test-bookmark2"
91
91
  And press "Insert Link"
92
- Then the contents of the editable region should be "this is <a name='test-bookmark2'>simple</a> <a href='#test-bookmark1'>content</a>"
92
+ Then the contents of the full region should be "this is <a name='test-bookmark2'>simple</a> <a href='#test-bookmark1'>content</a>"
93
93
 
94
94
  # todo: when I change the name of a bookmark, and bookmarks that are pointing to me should also be updated (on this page)
95
95
 
@@ -12,7 +12,7 @@ Feature:
12
12
 
13
13
 
14
14
  # Scenario: A user can insert and edit an image
15
- Given the content of the editable region is simple content
15
+ Given the content of the full region is simple content
16
16
  And I make a selection
17
17
 
18
18
  When I click on the "Insert Media" button
@@ -21,7 +21,7 @@ Feature:
21
21
 
22
22
  When I fill in "URL" with "/assets/mercury/temp-logo.png"
23
23
  And press "Insert Media"
24
- Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png'> <b>content</b>"
24
+ Then the contents of the full region should be "this is <img src='/assets/mercury/temp-logo.png'> <b>content</b>"
25
25
  And the modal window should not be visible
26
26
 
27
27
  When I make a selection for "img"
@@ -30,30 +30,30 @@ Feature:
30
30
 
31
31
  When I fill in "URL" with "/assets/mercury/default-snippet.png"
32
32
  And press "Insert Media"
33
- Then the contents of the editable region should be "this is <img src='/assets/mercury/default-snippet.png'> <b>content</b>"
33
+ Then the contents of the full region should be "this is <img src='/assets/mercury/default-snippet.png'> <b>content</b>"
34
34
 
35
35
 
36
36
  # Scenario: A user can insert and edit an image with an alignment set
37
- Given the content of the editable region is simple content
37
+ Given the content of the full region is simple content
38
38
  And I make a selection
39
39
 
40
40
  When I click on the "Insert Media" button
41
41
  When I fill in "media_image_url" with "/assets/mercury/temp-logo.png"
42
42
  And select "Right" from "Alignment"
43
43
  And press "Insert Media"
44
- Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png' align='right'> <b>content</b>"
44
+ Then the contents of the full region should be "this is <img src='/assets/mercury/temp-logo.png' align='right'> <b>content</b>"
45
45
 
46
46
  When I make a selection for "img"
47
47
  And click on the "Insert Media" button
48
48
  And select "Absolute Middle" from "Alignment"
49
49
  And press "Insert Media"
50
- Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png' align='absmiddle'> <b>content</b>"
50
+ Then the contents of the full region should be "this is <img src='/assets/mercury/temp-logo.png' align='absmiddle'> <b>content</b>"
51
51
 
52
52
 
53
53
  Scenario: A user can edit an image by double clicking it
54
- Given the content of the editable region has an image
54
+ Given the content of the full region has an image
55
55
 
56
- When I double click on the first image in the editable region
56
+ When I double click on the first image in the full region
57
57
  Then the modal window should be visible
58
58
  And I should see "Insert Media (images and videos)" within the modal title
59
59
  And the "media_image_url" field should contain "/assets/mercury/temp-logo.png"
@@ -61,11 +61,11 @@ Feature:
61
61
  When I fill in "URL" with "/assets/mercury/default-snippet.png"
62
62
  And select "Absolute Middle" from "Alignment"
63
63
  And press "Insert Media"
64
- Then the contents of the editable region should be "this is <img src='/assets/mercury/default-snippet.png' align='absmiddle'> <b>content</b>"
64
+ Then the contents of the full region should be "this is <img src='/assets/mercury/default-snippet.png' align='absmiddle'> <b>content</b>"
65
65
 
66
66
 
67
67
  Scenario: A user can embed and edit a youtube video
68
- Given the content of the editable region is simple content
68
+ Given the content of the full region is simple content
69
69
  And I make a selection
70
70
 
71
71
  When I click on the "Insert Media" button
@@ -74,7 +74,7 @@ Feature:
74
74
  And fill in "Width" with "400"
75
75
  And fill in "Height" with "200"
76
76
  And press "Insert Media"
77
- Then the contents of the editable region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eII?wmode=transparent' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
77
+ Then the contents of the full region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eII?wmode=transparent' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
78
78
 
79
79
  When I make a selection for "iframe"
80
80
  And click on the "Insert Media" button
@@ -84,11 +84,11 @@ Feature:
84
84
  And fill in "Width" with "500"
85
85
  And fill in "Height" with "300"
86
86
  And press "Insert Media"
87
- Then the contents of the editable region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eI?wmode=transparent' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
87
+ Then the contents of the full region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eI?wmode=transparent' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
88
88
 
89
89
 
90
90
  # Scenario: A user can embed and edit a vimeo video
91
- Given the content of the editable region is simple content
91
+ Given the content of the full region is simple content
92
92
  And I make a selection
93
93
 
94
94
  When I click on the "Insert Media" button
@@ -97,7 +97,7 @@ Feature:
97
97
  And fill in "Width" with "400"
98
98
  And fill in "Height" with "200"
99
99
  And press "Insert Media"
100
- Then the contents of the editable region should be "this is <iframe src='http://player.vimeo.com/video/25708134?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
100
+ Then the contents of the full region should be "this is <iframe src='http://player.vimeo.com/video/25708134?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
101
101
 
102
102
  When I make a selection for "iframe"
103
103
  And click on the "Insert Media" button
@@ -107,4 +107,4 @@ Feature:
107
107
  And fill in "Width" with "500"
108
108
  And fill in "Height" with "300"
109
109
  And press "Insert Media"
110
- Then the contents of the editable region should be "this is <iframe src='http://player.vimeo.com/video/2570813?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
110
+ Then the contents of the full region should be "this is <iframe src='http://player.vimeo.com/video/2570813?title=1&amp;byline=1&amp;portrait=0&amp;color=ffffff' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
@@ -12,12 +12,12 @@ Feature:
12
12
 
13
13
 
14
14
  # todo: these can't be one scenario because snippet.load doesn't find/replace existing ones
15
- Scenario: A user can drag and drop snippets into an editable region
16
- Given the content of the editable region is simple content
15
+ Scenario: A user can drag and drop snippets into a full region
16
+ Given the content of the full region is simple content
17
17
  And I make a selection
18
18
 
19
19
  When I open the snippet panel
20
- And I drag the example snippet into the editable region
20
+ And I drag the example snippet into the full region
21
21
  Then the modal window should be visible
22
22
  And I should see "Snippet Options" within the modal title
23
23
 
@@ -25,23 +25,23 @@ Feature:
25
25
  And fill in "Favorite Beer" with "Stella"
26
26
  And press "Insert Snippet"
27
27
  Then the modal window should not be visible
28
- And the contents of the editable region should be "this is <div data-version='1' data-snippet='snippet_14' class='mercury-snippet example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div><span>simple</span> <b>content</b>"
28
+ And the contents of the full region should be "this is <div data-version='1' data-snippet='snippet_14' class='example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div><span>simple</span> <b>content</b>"
29
29
 
30
30
 
31
31
  Scenario: A user can use the snippet toolbar to remove a snippet
32
32
  Given the options for the example snippet "snippet_42" are first_name: "Jeremy", favorite_beer: "Stella"
33
- And the content of the editable region has that snippet
33
+ And the content of the full region has that snippet
34
34
 
35
35
  When I hover over the snippet
36
36
  Then the snippet toolbar should be visible
37
37
 
38
38
  When I click on the remove snippet toolbar button
39
- Then the contents of the editable region should be " <b>content</b>"
39
+ Then the contents of the full region should be " <b>content</b>"
40
40
 
41
41
 
42
42
  Scenario: A user can use the snippet toolbar to edit the options of a snippet
43
43
  Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
44
- And the content of the editable region has that snippet
44
+ And the content of the full region has that snippet
45
45
 
46
46
  When I hover over the snippet
47
47
  And click on the edit snippet settings toolbar button
@@ -52,18 +52,18 @@ Feature:
52
52
  When I fill in "First Name" with "Jeremy"
53
53
  And fill in "Favorite Beer" with "Stella"
54
54
  And press "Insert Snippet"
55
- Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
55
+ Then the contents of the full region should be "<div data-version='2' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
56
56
 
57
57
 
58
58
  Scenario: A user can make changes to a snippets options, and they'll be versioned for undo and redo
59
59
  Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
60
- And the content of the editable region has that snippet
60
+ And the content of the full region has that snippet
61
61
 
62
62
  When I edit the snippet
63
63
  And I fill in "First Name" with "Jeremy"
64
64
  And fill in "Favorite Beer" with "Stella"
65
65
  And press "Insert Snippet"
66
- Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
66
+ Then the contents of the full region should be "<div data-version='2' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
67
67
 
68
68
  When I edit the snippet
69
69
  Then the "First Name" field should contain "Jeremy"
@@ -72,10 +72,10 @@ Feature:
72
72
  When fill in "First Name" with "Diesel"
73
73
  And fill in "Favorite Beer" with "Bells Hopslam"
74
74
  And press "Insert Snippet"
75
- Then the content of the editable region should be "<div data-version='3' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
75
+ Then the content of the full region should be "<div data-version='3' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
76
76
 
77
77
  When I click on the "Undo" button
78
- Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
78
+ Then the contents of the full region should be "<div data-version='2' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
79
79
 
80
80
  When I edit the snippet
81
81
  # todo: this is a bug
@@ -84,7 +84,7 @@ Feature:
84
84
 
85
85
  When I close the modal
86
86
  When I click on the "Redo" button
87
- Then the contents of the editable region should be "<div data-version='3' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
87
+ Then the contents of the full region should be "<div data-version='3' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
88
88
 
89
89
  When I edit the snippet
90
90
  Then the "First Name" field should contain "Diesel"
@@ -93,10 +93,10 @@ Feature:
93
93
  When I fill in "First Name" with "Jen"
94
94
  And fill in "Favorite Beer" with "Miller High Life"
95
95
  And press "Insert Snippet"
96
- Then the contents of the editable region should be "<div data-version='4' data-snippet='snippet_42' class='mercury-snippet example-snippet' contenteditable='false'><strong>Jen</strong> likes Miller High Life</div> <b>content</b>"
96
+ Then the contents of the full region should be "<div data-version='4' data-snippet='snippet_42' class='example-snippet' contenteditable='false'><strong>Jen</strong> likes Miller High Life</div> <b>content</b>"
97
97
 
98
98
 
99
99
  # Scenario: When a user saves, the snippets should be gone from the html, but the options are serialized
100
100
  # Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
101
- # And the content of the editable region has that snippet
101
+ # And the content of the full region has that snippet
102
102
  # When I click on the "Save" button
@@ -12,7 +12,7 @@ Feature:
12
12
 
13
13
 
14
14
  # Scenario: A user can insert special characters
15
- Given the content of the editable region is simple content
15
+ Given the content of the full region is simple content
16
16
  And I make a selection
17
17
 
18
18
  When I click on the "Insert Character" button
@@ -21,4 +21,4 @@ Feature:
21
21
 
22
22
  When I click on the sweet snowman
23
23
  Then the modal window should not be visible
24
- And the contents of the editable region should be "this is ☃ <b>content</b>"
24
+ And the contents of the full region should be "this is ☃ <b>content</b>"
@@ -0,0 +1,109 @@
1
+ @javascript
2
+ Feature:
3
+ As a content editor type person
4
+ In order to manage content
5
+ I should be able to insert and edit complex tables
6
+
7
+ Background:
8
+ Given I am on an editable page
9
+ And the editor won't prompt when leaving the page
10
+
11
+ Scenario: A user can expect all this!
12
+
13
+
14
+ # Scenario: A user can insert a table
15
+ Given the content of the full region is simple content
16
+ And I make a selection
17
+
18
+ When I click on the "Insert Table" button
19
+ Then the modal window should be visible
20
+ And I should see "Insert Table" within the modal title
21
+
22
+ When I click on the third cell in the first row
23
+ And I add a column before it
24
+ Then the table column count should be 4
25
+ And the selected cell should be the forth cell in the first row
26
+
27
+ When I add a column after
28
+ Then the table column count should be 5
29
+ And the selected cell should be the forth cell in the first row
30
+
31
+ When I add a row after
32
+ Then the table row count should be 3
33
+ And the selected cell should be the forth cell in the first row
34
+
35
+ When I add a row before
36
+ Then the table row count should be 4
37
+ And the selected cell should be the forth cell in the second row
38
+
39
+ When I delete the column
40
+ Then the table column count should be 4
41
+ And a selected cell should not be visible
42
+
43
+ When I click on the second cell in the second row
44
+ And delete the row
45
+ Then the table row count should be 3
46
+ And a selected cell should not be visible
47
+
48
+ When I click on the second cell in the second row
49
+ And increase the colspan
50
+ And click on the first cell in the first row
51
+ And increase the rowspan
52
+ And select "Right" from "Alignment"
53
+ And fill in "Border" with "2"
54
+ And fill in "Spacing" with "2"
55
+ And press "Insert Table"
56
+ Then the contents of the full region should be "this is&nbsp;<table align='right' border='2' cellspacing='2'><tbody><tr><td rowspan='2'><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td colspan='2'><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr></tbody></table> <b>content</b>"
57
+ And the modal window should not be visible
58
+
59
+
60
+ # Scenario: A user can edit a table after inserting one (in a full region)
61
+ Given the content of the full region has a table
62
+ And I make a selection
63
+
64
+ When I click on the add row before editor button
65
+ Then the table row count should be 3
66
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td></tr><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
67
+
68
+ When I click on the add row after editor button
69
+ Then the table row count should be 4
70
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td></tr><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td><br></td><td><br></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
71
+
72
+ When I click on the add column before editor button
73
+ Then the column count should be 3
74
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><span>1</span></td><td><span>2</span></td></tr><tr><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
75
+
76
+ When I click on the add column after editor button
77
+ Then the column count should be 4
78
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><span>1</span></td><td><br></td><td><span>2</span></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><span>3</span></td><td><br></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
79
+
80
+ When I click on the delete row editor button
81
+ Then the table row count should be 3
82
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><span>3</span></td><td><br></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
83
+
84
+ When I make a selection
85
+ And click on the delete column editor button
86
+ Then the table column count should be 3
87
+ And the contents of the full region should be "this is a <table><tbody><tr><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><br></td></tr><tr><td><br></td><td><br></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
88
+
89
+
90
+ # Scenario: A user can adjust the colspans of a table (in a full region)
91
+ Given the content of the full region has a table
92
+ And I make a selection
93
+
94
+ When I click on the increase colspan editor button
95
+ Then the contents of the full region should be "this is a <table><tbody><tr><td colspan='2'><span>1</span></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
96
+
97
+ When I click on the decrease colspan editor button
98
+ Then the contents of the full region should be "this is a <table><tbody><tr><td><span>1</span></td><td><br></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
99
+
100
+
101
+ # Scenario: A user can adjust the rowspans of a table (in a full region)
102
+ Given the content of the full region has a table
103
+ And I make a selection
104
+
105
+ When I click on the increase rowspan editor button
106
+ Then the contents of the full region should be "this is a <table><tbody><tr><td rowspan='2'><span>1</span></td><td><span>2</span></td></tr><tr><td><span>4</span></td></tr></tbody></table> <b>content</b>"
107
+
108
+ When I click on the decrease rowspan editor button
109
+ Then the contents of the full region should be "this is a <table><tbody><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td><br></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
@@ -9,19 +9,19 @@ Feature:
9
9
  And save results will be cached
10
10
 
11
11
 
12
- Scenario: A user can change content in an editable region and save those changes
13
- When I set the content of the editable region to "new content"
12
+ Scenario: A user can change content in a full region and save those changes
13
+ When I set the content of the full region to "new content"
14
14
  And I click on the "Save" button
15
- Then the save should have "new content" for the editable region
15
+ Then the save should have "new content" for the full region
16
16
 
17
17
 
18
- Scenario: A user can change content in a markupable region and save those changes
19
- When I set the content of the markupable region to "new content"
18
+ Scenario: A user can change content in a markdown region and save those changes
19
+ When I set the content of the markdown region to "new content"
20
20
  And I click on the "Save" button
21
- Then the save should have "new content" for the markupable region
21
+ Then the save should have "new content" for the markdown region
22
22
 
23
23
 
24
- Scenario: A user can put snippets into an editable region and get the options on save
24
+ Scenario: A user can put snippets into a full region and get the options on save
25
25
  # todo: finish
26
26
 
27
27
 
@@ -29,5 +29,5 @@ Feature:
29
29
  # todo: finish
30
30
 
31
31
 
32
- Scenario: A user can put snippets into a markupable region and get the options on save
32
+ Scenario: A user can put snippets into a markdown region and get the options on save
33
33
  # todo: finish