decko 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/decko.gemspec +3 -3
- data/features/attach.feature +11 -7
- data/features/follow.feature +45 -44
- data/features/navbox.feature +1 -1
- data/features/notifications.feature +1 -1
- data/features/pointer_inputs.feature +7 -0
- data/features/reference.feature +5 -1
- data/features/step_definitions/email_steps.rb +4 -0
- data/features/step_definitions/wagn_steps.rb +6 -3
- data/features/step_definitions/web_steps.rb +1 -0
- data/features/support/delayed_job.rb +1 -0
- data/features/support/env.rb +5 -2
- data/features/toolbar.feature +13 -11
- data/lib/decko/application.rb +1 -0
- data/lib/decko/commands/cucumber_command.rb +2 -2
- data/lib/decko/commands/cucumber_command/parser.rb +8 -0
- data/lib/decko/commands/rspec_command.rb +3 -3
- data/lib/decko/config/environments/development.rb +3 -2
- data/lib/decko/config/environments/production.rb +4 -0
- data/lib/decko/config/environments/test.rb +2 -2
- data/lib/decko/config/initializers/sedate_parser.rb +7 -0
- data/lib/decko/engine.rb +1 -1
- data/lib/decko/generators/decko/templates/Gemfile +16 -22
- data/lib/decko/mods_spec_helper.rb +0 -1
- data/lib/decko/response.rb +18 -12
- data/lib/decko/tasks/alias.rb +31 -0
- data/lib/decko/tasks/decko.rake +16 -43
- data/lib/decko/tasks/decko/bootstrap.rake +65 -62
- data/lib/decko/tasks/test.rake +10 -3
- data/rails/controllers/card_controller.rb +16 -10
- data/rails/engine-routes.rb +4 -1
- data/spec/controllers/card_controller_spec.rb +77 -58
- data/spec/controllers/location_spec.rb +4 -4
- metadata +10 -9
- data/lib/decko/tasks/decko/migrate.rake +0 -77
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b69a705d159befd136026205b4023c37694e92e0
|
4
|
+
data.tar.gz: f8183b7062dc891b0c26792967bbaa9ba443c573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa8968d82b45b4b5b90709082603f9e02023002d73bf4ca70dd4e60829baa380532fb9be5ec627093ce9a2bf7dbfa0aac6752bde2b46ad9066fa18529d964acf
|
7
|
+
data.tar.gz: f7f7bbde5063c892a97f93fd8b3837ef07c4a6478003ffdf2180bd629f8300c39946f28ba8a927bb646abe54a0380d489ff976a155722c7052a0e1401094e638
|
data/decko.gemspec
CHANGED
@@ -6,7 +6,7 @@ vbits = version.split('.').map &:to_i
|
|
6
6
|
vplus = { 0 => 90, 1 => 100 } # can remove and hardcode after 1.0
|
7
7
|
vminor = vplus[ vbits[0] ] + vbits[1]
|
8
8
|
card_version = [1, vminor, vbits[2]].compact.map(&:to_s).join "."
|
9
|
-
# see card.
|
9
|
+
# see card.gemspec for explanation of all of this, which has been ham-handedly
|
10
10
|
# cut and pasted here.
|
11
11
|
|
12
12
|
|
@@ -31,10 +31,10 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
32
32
|
s.require_paths = ["lib"]
|
33
33
|
|
34
|
-
s.required_ruby_version = ">=
|
34
|
+
s.required_ruby_version = ">= 2.2.2"
|
35
35
|
|
36
36
|
[
|
37
|
-
["rails", "~>
|
37
|
+
["rails", "~> 5.1"],
|
38
38
|
["card", card_version]
|
39
39
|
].each do |dep|
|
40
40
|
s.add_runtime_dependency(*dep)
|
data/features/attach.feature
CHANGED
@@ -12,6 +12,7 @@ Feature: File Upload
|
|
12
12
|
And I press "Submit"
|
13
13
|
Then I should see "Problems with"
|
14
14
|
And I should see "is missing"
|
15
|
+
And I wait for ajax response
|
15
16
|
|
16
17
|
Scenario: Uploading a file
|
17
18
|
When I go to new File
|
@@ -22,23 +23,30 @@ Feature: File Upload
|
|
22
23
|
Then I should see "Add File..."
|
23
24
|
When I upload the file "file.txt"
|
24
25
|
And I wait for ajax response
|
26
|
+
And I wait 3 seconds
|
25
27
|
And I fill in "card_name" with "a test file"
|
26
28
|
And I press "Submit"
|
29
|
+
And I wait 2 seconds
|
27
30
|
Then I should see "Download a test file"
|
31
|
+
And I wait for ajax response
|
28
32
|
|
29
33
|
Scenario: Uploading and changing an image
|
30
34
|
When I go to new Image
|
31
35
|
And I upload the image "image.png"
|
32
36
|
And I wait for ajax response
|
37
|
+
And I wait 3 seconds
|
33
38
|
Then I should see "image.png 34.3 KB"
|
34
39
|
And I fill in "card_name" with "a test image"
|
35
40
|
And I press "Submit"
|
41
|
+
And I wait 3 seconds
|
36
42
|
Then I should see an image of size "large" and type "png"
|
37
43
|
And I edit "a test image"
|
38
44
|
And I upload the image "image2.jpg"
|
39
45
|
And I wait for ajax response
|
46
|
+
And I wait 3 seconds
|
40
47
|
Then I should see "image2.jpg 69.8 KB"
|
41
48
|
And I press "Submit"
|
49
|
+
And I wait 3 seconds
|
42
50
|
Then I should see an image of size "large" and type "jpg"
|
43
51
|
And I wait for ajax response
|
44
52
|
|
@@ -50,6 +58,7 @@ Feature: File Upload
|
|
50
58
|
And I press "Submit"
|
51
59
|
And I wait for ajax response
|
52
60
|
Then I should see a non-coded image of size "large" and type "jpg"
|
61
|
+
And I wait for ajax response
|
53
62
|
|
54
63
|
Scenario: uploading a file as a field in a form
|
55
64
|
When I go to "/new Cardtype"
|
@@ -77,7 +86,6 @@ Feature: File Upload
|
|
77
86
|
And I upload the image "image.png"
|
78
87
|
And I wait for ajax response
|
79
88
|
And I press "Submit"
|
80
|
-
And I wait for ajax response
|
81
89
|
And I edit "Vignesh has a complicated relationship"
|
82
90
|
And I upload the image "image2.jpg"
|
83
91
|
And I wait for ajax response
|
@@ -97,11 +105,7 @@ Feature: File Upload
|
|
97
105
|
And I upload the image "image.png"
|
98
106
|
And I wait for ajax response
|
99
107
|
And I press "Submit"
|
100
|
-
And I wait for ajax response
|
101
108
|
And I edit "Vignesh has a complicated relationship"
|
102
109
|
And I press "Submit"
|
103
|
-
|
104
|
-
|
105
|
-
And I wait for ajax response
|
106
|
-
|
107
|
-
|
110
|
+
Then I should see "+image"
|
111
|
+
And I should see an image of size "medium" and type "png"
|
data/features/follow.feature
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
@wip
|
1
2
|
@javascript
|
2
3
|
Feature: Follow interface
|
3
4
|
In order to make use of notifications
|
@@ -7,50 +8,50 @@ Feature: Follow interface
|
|
7
8
|
Background:
|
8
9
|
Given I am signed in as Joe User
|
9
10
|
|
10
|
-
Scenario: Anonymous User should not see follow UI
|
11
|
-
Given I follow "Sign out"
|
12
|
-
When I go to the homepage
|
13
|
-
And I open the main card menu
|
14
|
-
Then I should not see "follow"
|
15
|
-
|
16
|
-
Scenario: Following a Card
|
17
|
-
Given Joe User is not watching "Home+*self"
|
18
|
-
When I go to the homepage
|
19
|
-
And I open the main card menu
|
20
|
-
And In the main card menu I should not see "unfollow"
|
21
|
-
And In the main card menu I click "follow"
|
22
|
-
And I wait a sec
|
23
|
-
And I close the modal window
|
24
|
-
And I wait a sec
|
25
|
-
And I open the main card menu
|
26
|
-
Then In the main card menu I should see "unfollow"
|
27
|
-
And the card Home+*self+Joe User+*follow should point to "always"
|
28
|
-
|
29
|
-
Scenario: Unfollowing a Card
|
30
|
-
Given Joe User is watching "Home+*self"
|
31
|
-
And the card Home+*self+Joe User+*follow should point to "always"
|
32
|
-
And I am on the homepage
|
33
|
-
And I open the main card menu
|
34
|
-
And In the main card menu I click "unfollow"
|
35
|
-
And I wait a sec
|
36
|
-
And I close the modal window
|
37
|
-
And I wait a sec
|
38
|
-
And I open the main card menu
|
39
|
-
Then In the main card menu I should see "follow"
|
40
|
-
And the card Home+*self+Joe User+*follow should point to "never"
|
41
|
-
|
42
|
-
|
43
|
-
Scenario: Following a Cardtype
|
44
|
-
When I go to card User
|
45
|
-
And I open the main card menu
|
46
|
-
Then In the main card menu I should see "follow"
|
47
|
-
|
48
|
-
Scenario: A Card whose Cardtype is Followed
|
49
|
-
Given Joe User is watching "User+*type"
|
50
|
-
And I go to card Joe User
|
51
|
-
And I open the main card menu
|
52
|
-
Then In the main card menu I should see "(following)|unfollow"
|
53
|
-
And I wait a sec
|
11
|
+
# Scenario: Anonymous User should not see follow UI
|
12
|
+
# Given I follow "Sign out"
|
13
|
+
# When I go to the homepage
|
14
|
+
# And I open the main card menu
|
15
|
+
# Then I should not see "follow"
|
16
|
+
#
|
17
|
+
# Scenario: Following a Card
|
18
|
+
# Given Joe User is not watching "Home+*self"
|
19
|
+
# When I go to the homepage
|
20
|
+
# And I open the main card menu
|
21
|
+
# And In the main card menu I should not see "unfollow"
|
22
|
+
# And In the main card menu I click "follow"
|
23
|
+
# And I wait a sec
|
24
|
+
# And I close the modal window
|
25
|
+
# And I wait a sec
|
26
|
+
# And I open the main card menu
|
27
|
+
# Then In the main card menu I should see "unfollow"
|
28
|
+
# And the card Home+*self+Joe User+*follow should point to "always"
|
29
|
+
#
|
30
|
+
# Scenario: Unfollowing a Card
|
31
|
+
# Given Joe User is watching "Home+*self"
|
32
|
+
# And the card Home+*self+Joe User+*follow should point to "always"
|
33
|
+
# And I am on the homepage
|
34
|
+
# And I open the main card menu
|
35
|
+
# And In the main card menu I click "unfollow"
|
36
|
+
# And I wait a sec
|
37
|
+
# And I close the modal window
|
38
|
+
# And I wait a sec
|
39
|
+
# And I open the main card menu
|
40
|
+
# Then In the main card menu I should see "follow"
|
41
|
+
# And the card Home+*self+Joe User+*follow should point to "never"
|
42
|
+
#
|
43
|
+
#
|
44
|
+
# Scenario: Following a Cardtype
|
45
|
+
# When I go to card User
|
46
|
+
# And I open the main card menu
|
47
|
+
# Then In the main card menu I should see "follow"
|
48
|
+
#
|
49
|
+
# Scenario: A Card whose Cardtype is Followed
|
50
|
+
# Given Joe User is watching "User+*type"
|
51
|
+
# And I go to card Joe User
|
52
|
+
# And I open the main card menu
|
53
|
+
# Then In the main card menu I should see "(following)|unfollow"
|
54
|
+
# And I wait a sec
|
54
55
|
|
55
56
|
#too long for menu
|
56
57
|
#
|
data/features/navbox.feature
CHANGED
@@ -23,7 +23,7 @@ Feature: Notifications
|
|
23
23
|
#FIXME these double quotes are ugly
|
24
24
|
And I should see |You received this email because you're following "all "Phrases""| in the email body
|
25
25
|
When I am signed in as Joe Admin
|
26
|
-
And I follow "Unfollow" in the email
|
26
|
+
And I follow "Unfollow" in the email to "joe@admin.com"
|
27
27
|
Then the card Phrase+*type+*followers should not point to "Joe Admin"
|
28
28
|
|
29
29
|
Scenario: Watching a Card
|
@@ -11,9 +11,11 @@ Feature: Pointer Inputs
|
|
11
11
|
|
12
12
|
Scenario: Creating a card with select input
|
13
13
|
Given I create Phrase card "friends+*right+*input" with content "select"
|
14
|
+
And I wait for ajax response
|
14
15
|
When I go to card "Joe User+friends"
|
15
16
|
And I select "Joe Camel" from "Content"
|
16
17
|
And I press "Submit"
|
18
|
+
And I wait for ajax response
|
17
19
|
And I go to card "Joe User+friends"
|
18
20
|
Then I should see "Joe Camel"
|
19
21
|
|
@@ -23,6 +25,7 @@ Feature: Pointer Inputs
|
|
23
25
|
When I edit "Joe User"
|
24
26
|
And I select "Joe Admin" from "+friends"
|
25
27
|
And I press "Submit"
|
28
|
+
And I wait for ajax response
|
26
29
|
And I go to card "Joe User"
|
27
30
|
Then I should see "Joe Admin"
|
28
31
|
|
@@ -31,6 +34,7 @@ Feature: Pointer Inputs
|
|
31
34
|
When I go to card "Joe User+friends"
|
32
35
|
And I select "Joe Camel" from "Content"
|
33
36
|
And I press "Submit"
|
37
|
+
And I wait for ajax response
|
34
38
|
And I go to card "Joe User+friends"
|
35
39
|
Then I should see "Joe Camel"
|
36
40
|
|
@@ -48,6 +52,7 @@ Feature: Pointer Inputs
|
|
48
52
|
When I go to card "Joe User+friends"
|
49
53
|
And I choose "Joe Camel"
|
50
54
|
And I press "Submit"
|
55
|
+
And I wait for ajax response
|
51
56
|
And I go to card "Joe User+friends"
|
52
57
|
Then I should see "Joe Camel"
|
53
58
|
|
@@ -59,11 +64,13 @@ Feature: Pointer Inputs
|
|
59
64
|
Then I should see "boom yow yow"
|
60
65
|
And I check "Joe Camel"
|
61
66
|
And I press "Submit"
|
67
|
+
And I wait for ajax response
|
62
68
|
And I go to card "Joe User+friends"
|
63
69
|
Then I should see "Joe Camel"
|
64
70
|
And I edit "Joe User+friends"
|
65
71
|
And I uncheck "Joe Camel"
|
66
72
|
And I press "Submit"
|
73
|
+
And I wait for ajax response
|
67
74
|
And I go to card "Joe User+friends"
|
68
75
|
Then I should not see "Joe Camel"
|
69
76
|
|
data/features/reference.feature
CHANGED
@@ -9,13 +9,17 @@ Feature: Reference
|
|
9
9
|
|
10
10
|
Scenario: Renaming a embed card
|
11
11
|
When I create PlainText card "Vignesh" with content "Indian"
|
12
|
+
And I wait for ajax response
|
13
|
+
And I wait 2 seconds
|
12
14
|
And I create PlainText card "Kawaii Man" with content "[[Vignesh]]"
|
15
|
+
And I wait for ajax response
|
13
16
|
And I go to rename "Vignesh"
|
14
17
|
And I fill in "card_name" with "Srivigneshwar"
|
15
18
|
And I press "Rename"
|
19
|
+
And I wait for ajax response
|
16
20
|
And I press "Rename and Update"
|
17
21
|
And I wait for ajax response
|
18
|
-
And I wait
|
22
|
+
And I wait 2 seconds
|
19
23
|
Then I go to card "Kawaii Man"
|
20
24
|
And I should see "Srivigneshwar"
|
21
25
|
|
@@ -162,6 +162,10 @@ When /^(?:I|they) follow "([^"]*?)" in the email$/ do |link| # "<- stop textma
|
|
162
162
|
visit_in_email(link)
|
163
163
|
end
|
164
164
|
|
165
|
+
When /^(?:I|they) follow "([^"]*?)" in the email to "([^"]*?)"$/ do |link, address| # "<- stop textmate from treating the rest of the file as a string
|
166
|
+
visit_in_email(link, address)
|
167
|
+
end
|
168
|
+
|
165
169
|
When /^(?:I|they) click the first link in the email$/ do
|
166
170
|
click_first_link_in_email
|
167
171
|
end
|
@@ -63,6 +63,7 @@ When wysiwyg_re do |username, cardname, content|
|
|
63
63
|
visit "/card/edit/#{cardname.to_name.url_key}"
|
64
64
|
page.execute_script "$('#main .d0-card-content').val('#{content}')"
|
65
65
|
click_button "Submit"
|
66
|
+
wait_for_ajax
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
@@ -72,6 +73,7 @@ When edit_re do |username, cardname, _field, content|
|
|
72
73
|
visit "/card/edit/#{cardname.to_name.url_key}"
|
73
74
|
set_content "card[content]", content
|
74
75
|
click_button "Submit"
|
76
|
+
wait_for_ajax
|
75
77
|
end
|
76
78
|
end
|
77
79
|
|
@@ -88,6 +90,7 @@ When /^(.*) edits? "([^\"]*)" with plusses:/ do |username, cardname, plusses|
|
|
88
90
|
set_content "card[subcards][#{cardname}+#{name}][content]", content
|
89
91
|
end
|
90
92
|
click_button "Submit"
|
93
|
+
wait_for_ajax
|
91
94
|
end
|
92
95
|
end
|
93
96
|
|
@@ -276,13 +279,13 @@ end
|
|
276
279
|
|
277
280
|
When /^In (.*) I find link with icon "(.*)" and click it$/ do |section, icon|
|
278
281
|
within scope_of(section) do
|
279
|
-
find("a >
|
282
|
+
find("a > i.material-icons", text: icon).click
|
280
283
|
end
|
281
284
|
end
|
282
285
|
|
283
286
|
When /^In (.*) I find button with icon "(.*)" and click it$/ do |section, icon|
|
284
287
|
within scope_of(section) do
|
285
|
-
find("button >
|
288
|
+
find("button > i.material-icons", text: icon).click
|
286
289
|
end
|
287
290
|
end
|
288
291
|
|
@@ -295,7 +298,7 @@ Then /I submit$/ do
|
|
295
298
|
end
|
296
299
|
|
297
300
|
When /^I open the main card menu$/ do
|
298
|
-
slot = "$('#main .menu-slot .vertical-card-menu.
|
301
|
+
slot = "$('#main .menu-slot .vertical-card-menu._show-on-hover .card-slot')"
|
299
302
|
page.execute_script "#{slot}.show()"
|
300
303
|
page.find("#main .menu-slot .card-menu a").click
|
301
304
|
end
|
data/features/support/env.rb
CHANGED
@@ -5,8 +5,8 @@ require "decko"
|
|
5
5
|
require File.join Decko.card_gem_root, "spec/support/simplecov_helper.rb"
|
6
6
|
require "simplecov"
|
7
7
|
require "minitest/autorun"
|
8
|
+
require "rspec"
|
8
9
|
|
9
|
-
require "rspec/expectations"
|
10
10
|
World(RSpec::Matchers)
|
11
11
|
require "rspec-html-matchers"
|
12
12
|
World(RSpecHtmlMatchers)
|
@@ -42,10 +42,13 @@ at_exit do
|
|
42
42
|
Card.seed_test_db
|
43
43
|
end
|
44
44
|
|
45
|
+
Before("@javascript") do
|
46
|
+
@javascript = true
|
47
|
+
end
|
45
48
|
|
46
49
|
require "cucumber/rails"
|
47
50
|
Cucumber::Rails::Database.autorun_database_cleaner = false
|
48
|
-
require "test_after_commit"
|
51
|
+
# require "test_after_commit"
|
49
52
|
|
50
53
|
Capybara.register_driver :selenium do |app|
|
51
54
|
Capybara::Selenium::Driver.new(app, browser: :chrome)
|
data/features/toolbar.feature
CHANGED
@@ -7,21 +7,23 @@ Feature: Toolbar
|
|
7
7
|
Background:
|
8
8
|
Given I am signed in as Joe Admin
|
9
9
|
And I go to card "Home"
|
10
|
+
And I wait for ajax response
|
10
11
|
And I open the main card menu
|
12
|
+
And I wait for ajax response
|
11
13
|
And I follow "edit"
|
12
14
|
|
13
15
|
Scenario: close toolbar
|
14
16
|
Then In main card frame I should see a nav with class "toolbar"
|
15
|
-
When In main card toolbar I find link with icon "
|
17
|
+
When In main card toolbar I find link with icon "close" and click it
|
16
18
|
Then In main card frame I should not see a nav with class "toolbar"
|
17
19
|
|
18
|
-
Scenario: pin and unpin toolbar
|
19
|
-
When In main card toolbar I find button with icon "pushpin" and click it
|
20
|
-
And I wait for ajax response
|
21
|
-
And I go to card "Home"
|
22
|
-
Then In main card frame I should see a nav with class "toolbar"
|
23
|
-
And In main card toolbar I should see a button with class "toolbar-pin.active"
|
24
|
-
When In main card toolbar I find button with icon "pushpin" and click it
|
25
|
-
And I wait for ajax response
|
26
|
-
And I go to card "Home"
|
27
|
-
Then In main card frame I should not see a nav with class "toolbar"
|
20
|
+
#Scenario: pin and unpin toolbar
|
21
|
+
# When In main card toolbar I find button with icon "pushpin" and click it
|
22
|
+
# And I wait for ajax response
|
23
|
+
# And I go to card "Home"
|
24
|
+
# Then In main card frame I should see a nav with class "toolbar"
|
25
|
+
# And In main card toolbar I should see a button with class "toolbar-pin.active"
|
26
|
+
# When In main card toolbar I find button with icon "pushpin" and click it
|
27
|
+
# And I wait for ajax response
|
28
|
+
# And I go to card "Home"
|
29
|
+
# Then In main card frame I should not see a nav with class "toolbar"
|
data/lib/decko/application.rb
CHANGED
@@ -13,7 +13,7 @@ module Decko
|
|
13
13
|
|
14
14
|
def command
|
15
15
|
@cmd ||=
|
16
|
-
"#{env_args} bundle exec cucumber #{require_args} #{feature_args}"
|
16
|
+
"#{env_args} #{@opts[:executer] || "bundle exec"} cucumber #{require_args} #{feature_args}"
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
@@ -40,7 +40,7 @@ module Decko
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def feature_paths
|
43
|
-
Card::Mod
|
43
|
+
Card::Mod.dirs.map do |p|
|
44
44
|
Dir.glob "#{p}/features"
|
45
45
|
end.flatten
|
46
46
|
end
|