decko 0.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b69a705d159befd136026205b4023c37694e92e0
4
- data.tar.gz: f8183b7062dc891b0c26792967bbaa9ba443c573
3
+ metadata.gz: a8459312b88bb6f76877b8f0e3a5792e5610ed60
4
+ data.tar.gz: 10096d5ead09136f7c016a8b441d45aa01690d19
5
5
  SHA512:
6
- metadata.gz: aa8968d82b45b4b5b90709082603f9e02023002d73bf4ca70dd4e60829baa380532fb9be5ec627093ce9a2bf7dbfa0aac6752bde2b46ad9066fa18529d964acf
7
- data.tar.gz: f7f7bbde5063c892a97f93fd8b3837ef07c4a6478003ffdf2180bd629f8300c39946f28ba8a927bb646abe54a0380d489ff976a155722c7052a0e1401094e638
6
+ metadata.gz: a2125a4799b751e4ade6c8edfe19dfc45aa785b3c2fa14e64324f29c72cace3d96a2494ae9bb568e518eb4f8bf81377eae715678ae0bf8eb51cb4282a26a6657
7
+ data.tar.gz: ba6c4f15324aed3d5f1b18dffc15f4ddcedd0e894ce44c27beed232cbdb8f8866aa8367accafd4f11b53eb366194284cf068e92cb4c1723659c373469b1560cf
@@ -4,7 +4,6 @@ Feature: File Upload
4
4
 
5
5
  Background:
6
6
  Given I am signed in as Joe Admin
7
- And I wait for ajax response
8
7
 
9
8
  Scenario: Block creating a new empty file
10
9
  When I go to new File
@@ -12,53 +11,37 @@ Feature: File Upload
12
11
  And I press "Submit"
13
12
  Then I should see "Problems with"
14
13
  And I should see "is missing"
15
- And I wait for ajax response
16
14
 
17
15
  Scenario: Uploading a file
18
16
  When I go to new File
19
17
  And I upload the file "file.txt"
20
- And I wait for ajax response
21
18
  Then I should see "file.txt 9 Bytes"
22
19
  When I press "Delete"
23
20
  Then I should see "Add File..."
24
21
  When I upload the file "file.txt"
25
- And I wait for ajax response
26
- And I wait 3 seconds
27
22
  And I fill in "card_name" with "a test file"
28
23
  And I press "Submit"
29
- And I wait 2 seconds
30
24
  Then I should see "Download a test file"
31
- And I wait for ajax response
32
25
 
33
26
  Scenario: Uploading and changing an image
34
27
  When I go to new Image
35
28
  And I upload the image "image.png"
36
- And I wait for ajax response
37
- And I wait 3 seconds
38
29
  Then I should see "image.png 34.3 KB"
39
30
  And I fill in "card_name" with "a test image"
40
31
  And I press "Submit"
41
- And I wait 3 seconds
42
32
  Then I should see an image of size "large" and type "png"
43
33
  And I edit "a test image"
44
34
  And I upload the image "image2.jpg"
45
- And I wait for ajax response
46
- And I wait 3 seconds
47
35
  Then I should see "image2.jpg 69.8 KB"
48
36
  And I press "Submit"
49
- And I wait 3 seconds
50
37
  Then I should see an image of size "large" and type "jpg"
51
- And I wait for ajax response
52
38
 
53
39
  Scenario: Changing a coded image
54
40
  When I edit "*logo"
55
41
  And I upload the image "image2.jpg"
56
- And I wait for ajax response
57
42
  Then I should see "image2.jpg 69.8 KB"
58
43
  And I press "Submit"
59
- And I wait for ajax response
60
44
  Then I should see a non-coded image of size "large" and type "jpg"
61
- And I wait for ajax response
62
45
 
63
46
  Scenario: uploading a file as a field in a form
64
47
  When I go to "/new Cardtype"
@@ -67,13 +50,10 @@ Feature: File Upload
67
50
  And I create HTML card "complicated card+*type+*structure" with content "{{+image}}{{+description}}"
68
51
  And I go to "/new complicated_card"
69
52
  And I fill in "card_name" with "Vignesh has a complicated relationship"
70
- And I wait for ajax response
71
53
  And I upload the image "image.png"
72
- And I wait for ajax response
73
54
  Then I should see "image.png 34.3 KB"
74
55
  And I press "Submit"
75
56
  Then I should see an image of size "medium" and type "png"
76
- And I wait for ajax response
77
57
 
78
58
  Scenario: updating a file as a field in a form
79
59
  When I go to "/new Cardtype"
@@ -82,17 +62,13 @@ Feature: File Upload
82
62
  And I create HTML card "complicated card+*type+*structure" with content "{{+image}}{{+description}}"
83
63
  And I go to "/new complicated_card"
84
64
  And I fill in "card_name" with "Vignesh has a complicated relationship"
85
- And I wait for ajax response
86
65
  And I upload the image "image.png"
87
- And I wait for ajax response
88
66
  And I press "Submit"
89
67
  And I edit "Vignesh has a complicated relationship"
90
68
  And I upload the image "image2.jpg"
91
- And I wait for ajax response
92
69
  Then I should see "image2.jpg 69.8 KB"
93
70
  And I press "Submit"
94
71
  Then I should see an image of size "medium" and type "jpg"
95
- And I wait for ajax response
96
72
 
97
73
  Scenario: submit a form without updating a file
98
74
  When I go to "/new Cardtype"
@@ -101,9 +77,7 @@ Feature: File Upload
101
77
  And I create HTML card "complicated card+*type+*structure" with content "{{+image}}{{+description}}"
102
78
  And I go to "/new complicated_card"
103
79
  And I fill in "card_name" with "Vignesh has a complicated relationship"
104
- And I wait for ajax response
105
80
  And I upload the image "image.png"
106
- And I wait for ajax response
107
81
  And I press "Submit"
108
82
  And I edit "Vignesh has a complicated relationship"
109
83
  And I press "Submit"
@@ -10,6 +10,7 @@ Feature: Layouts
10
10
  And the card "*all+*layout" contains "[[simple layout]]"
11
11
  And I create Pointer card "User+*type+*layout" with content "[[user layout]]"
12
12
  And I create HTML card "user layout" with content "User Header {{_main}}"
13
+ And I wait for ajax response
13
14
 
14
15
  Scenario: I visit a Basic card with the simple layout
15
16
  When I go to card "*account links"
@@ -7,20 +7,20 @@ Feature: Navbox
7
7
  Given I go to the homepage
8
8
  And I fill in "_keyword" with "Joe"
9
9
  # possible to use placeholder?
10
- And I wait a sec
10
+ # And I wait a sec
11
11
  Then I should see "Joe Camel"
12
12
  And I should see "JoeNow"
13
13
  Then I press enter to search
14
14
  #When I follow "search: Joe"
15
15
  # fixme: unable to click link so far...
16
- And I wait a sec
16
+ # And I wait a sec
17
17
  Then I should see "Search results"
18
18
 
19
19
  Scenario: wql search
20
20
  Given I go to the homepage
21
21
  And I fill in "_keyword" with '{"type":"User"}'
22
22
  Then I press enter to search
23
- And I wait a sec
23
+ # And I wait a sec
24
24
  Then I should see "Search results"
25
25
  And I should see "Big Brother"
26
26
 
@@ -1,7 +1,7 @@
1
1
  @javascript @delayed-jobs
2
2
  Feature: Notifications
3
- In order for Wagn to be a more effective communication platform
4
- Users should be able to track changes to Wagn cards from their email
3
+ In order for Decko to be a more effective communication platform
4
+ Users should be able to track changes to Decko cards from their email
5
5
 
6
6
  Scenario: Watching a Card
7
7
  Given Joe Admin is watching "All Eyes On Me+*self"
@@ -11,11 +11,9 @@ 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
15
14
  When I go to card "Joe User+friends"
16
15
  And I select "Joe Camel" from "Content"
17
16
  And I press "Submit"
18
- And I wait for ajax response
19
17
  And I go to card "Joe User+friends"
20
18
  Then I should see "Joe Camel"
21
19
 
@@ -25,7 +23,6 @@ Feature: Pointer Inputs
25
23
  When I edit "Joe User"
26
24
  And I select "Joe Admin" from "+friends"
27
25
  And I press "Submit"
28
- And I wait for ajax response
29
26
  And I go to card "Joe User"
30
27
  Then I should see "Joe Admin"
31
28
 
@@ -34,7 +31,6 @@ Feature: Pointer Inputs
34
31
  When I go to card "Joe User+friends"
35
32
  And I select "Joe Camel" from "Content"
36
33
  And I press "Submit"
37
- And I wait for ajax response
38
34
  And I go to card "Joe User+friends"
39
35
  Then I should see "Joe Camel"
40
36
 
@@ -52,7 +48,6 @@ Feature: Pointer Inputs
52
48
  When I go to card "Joe User+friends"
53
49
  And I choose "Joe Camel"
54
50
  And I press "Submit"
55
- And I wait for ajax response
56
51
  And I go to card "Joe User+friends"
57
52
  Then I should see "Joe Camel"
58
53
 
@@ -64,13 +59,11 @@ Feature: Pointer Inputs
64
59
  Then I should see "boom yow yow"
65
60
  And I check "Joe Camel"
66
61
  And I press "Submit"
67
- And I wait for ajax response
68
62
  And I go to card "Joe User+friends"
69
63
  Then I should see "Joe Camel"
70
64
  And I edit "Joe User+friends"
71
65
  And I uncheck "Joe Camel"
72
66
  And I press "Submit"
73
- And I wait for ajax response
74
67
  And I go to card "Joe User+friends"
75
68
  Then I should not see "Joe Camel"
76
69
 
@@ -7,6 +7,7 @@ Feature: Presetting content
7
7
  Given I am signed in as Joe User
8
8
  And I go to new Book presetting name to "Harry Potter" and author to "JK Rowling"
9
9
  And I press "Submit"
10
+ And I wait for ajax response
10
11
  When I go to card "Harry Potter+author"
11
12
  Then I should see "JK Rowling"
12
13
 
@@ -19,7 +19,7 @@ Feature: Reference
19
19
  And I wait for ajax response
20
20
  And I press "Rename and Update"
21
21
  And I wait for ajax response
22
- And I wait 2 seconds
22
+ And I wait 4 seconds
23
23
  Then I go to card "Kawaii Man"
24
24
  And I should see "Srivigneshwar"
25
25
 
@@ -13,6 +13,7 @@ Feature: Reset password
13
13
  And I follow "RESET PASSWORD"
14
14
  And I enter "joe@user.com" into "*email"
15
15
  And I press "Reset my password"
16
+ And I wait 4 seconds
16
17
  Then "joe@user.com" should receive an email with subject "reset password for My Wagn"
17
18
 
18
19
  When I open the email
@@ -1,13 +1,20 @@
1
+ @javascript
2
+
1
3
  Feature: Signing up
2
4
  In order to be able to contribute content and be credited for my contributions
3
5
  As a content editor
4
6
  I want to signup for an account
5
7
 
6
8
  Background:
7
- # By default Wagns are configured to require approval
9
+ Given I am signed in as "Joe Admin"
10
+ And I edit "Sign up+*type+*captcha"
11
+ And I uncheck "Content"
12
+ And I press "Submit"
13
+ # By default Wagns are configured to require approval
14
+ Given Joe Admin creates Pointer card "User+*type+*create" with content "[[Anyone]]"
15
+
8
16
 
9
17
  Scenario: Signing up (without approval) and then signing out and back in
10
- Given Joe Admin creates Pointer card "User+*type+*create" with content "[[Anyone]]"
11
18
  And I am signed out
12
19
  #This is the needed permission configuration to allow signups without approval
13
20
 
@@ -25,6 +32,7 @@ Feature: Signing up
25
32
  Then I should see "Wanna B"
26
33
  And "Wanna B" should be signed in
27
34
 
35
+
28
36
  When I go to the home page
29
37
  And I follow "Sign out"
30
38
  Then I should not see "Wanna B"
@@ -35,7 +43,11 @@ Feature: Signing up
35
43
  And I press "Sign in"
36
44
  Then I should see "Wanna B"
37
45
  And "Wanna B" should be signed in
38
- Scenario: Signing up with approval
46
+
47
+
48
+ #Scenario: Signing up with approval
49
+ #Given I am signed out
50
+
39
51
  #When I go to card "AccountRequest"
40
52
  #And In the main card content I click "Wanna B"
41
53
  #When In the main card content I click "Invite Wanna B"
@@ -193,9 +193,7 @@ Then /^save and open all raw emails$/ do
193
193
  end
194
194
 
195
195
  Then /^(.*) should be notified that "(.*)"$/ do |username, subject|
196
- Timeout.timeout(Capybara.default_max_wait_time) do
197
- sleep(0.5) while page.evaluate_script("jQuery.active") != 0
198
- end
196
+ wait_for_ajax
199
197
  Delayed::Worker.new.work_off
200
198
  email = address_for_user username
201
199
  begin
@@ -207,9 +205,7 @@ Then /^(.*) should be notified that "(.*)"$/ do |username, subject|
207
205
  end
208
206
 
209
207
  Then /^No notification should be sent$/ do
210
- Timeout.timeout(Capybara.default_max_wait_time) do
211
- sleep(0.5) while page.evaluate_script("jQuery.active") != 0
212
- end
208
+ wait_for_ajax
213
209
  Delayed::Worker.new.work_off
214
210
  expect(all_emails).to be_empty
215
211
  end
@@ -157,6 +157,7 @@ When /^(?:|I )upload the (.+) "(.+)"$/ do |attachment_name, filename|
157
157
  Capybara.ignore_hidden_elements = false
158
158
  attach_file "card_#{attachment_name}", find_file(filename)
159
159
  Capybara.ignore_hidden_elements = true
160
+ wait_for_ajax
160
161
  end
161
162
 
162
163
  def find_file filename
@@ -191,17 +192,16 @@ end
191
192
 
192
193
  def wait_for_ajax
193
194
  Timeout.timeout(Capybara.default_max_wait_time) do
194
- begin
195
- sleep(0.5) until finished_all_ajax_requests?
196
- rescue Selenium::WebDriver::Error::UnknownError
197
- sleep(2) # HACK: to fix the issue that in layout.feature jQuery
198
- # after the layout change is not defined
199
- end
195
+ sleep(0.5) until finished_all_ajax_requests?
200
196
  end
201
197
  end
202
198
 
203
199
  def finished_all_ajax_requests?
204
- page.evaluate_script("jQuery.active").zero?
200
+ jquery_undefined? || page.evaluate_script("jQuery.active").zero?
201
+ end
202
+
203
+ def jquery_undefined?
204
+ page.evaluate_script("typeof(jQuery) === 'undefined'")
205
205
  end
206
206
 
207
207
  When /^I wait for ajax response$/ do
@@ -42,6 +42,7 @@ end
42
42
 
43
43
  When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
44
44
  fill_in(field, with: value)
45
+ wait_for_ajax if @javascript && field == "card_name"
45
46
  end
46
47
 
47
48
  When /^(?:|I )fill in "([^"]*)" with '([^']*)'$/ do |field, value|
@@ -29,12 +29,12 @@ Before("@no-db-clean-between-scenarios") do |scenario|
29
29
  $feature_seeded.add scenario.feature.name
30
30
  end
31
31
 
32
- Before("~@background-jobs", "~@delayed-jobs", "~@javascript") do
32
+ Before("not @background-jobs", "not @delayed-jobs", "not @javascript") do
33
33
  DatabaseCleaner.strategy = :transaction
34
34
  DatabaseCleaner.start
35
35
  end
36
36
 
37
- After("~@background-jobs", "~@delayed-jobs", "~@javascript") do
37
+ After("not @background-jobs", "not @delayed-jobs", "not @javascript") do
38
38
  DatabaseCleaner.clean
39
39
  end
40
40
 
@@ -46,6 +46,10 @@ Before("@javascript") do
46
46
  @javascript = true
47
47
  end
48
48
 
49
+ Before do
50
+ Capybara.page.current_window.resize_to(1440, 900)
51
+ end
52
+
49
53
  require "cucumber/rails"
50
54
  Cucumber::Rails::Database.autorun_database_cleaner = false
51
55
  # require "test_after_commit"
@@ -53,6 +57,7 @@ Cucumber::Rails::Database.autorun_database_cleaner = false
53
57
  Capybara.register_driver :selenium do |app|
54
58
  Capybara::Selenium::Driver.new(app, browser: :chrome)
55
59
  end
60
+ Capybara.default_driver = :selenium
56
61
 
57
62
  # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
58
63
  # order to ease the transition to Capybara we set the default here. If you'd
@@ -7,5 +7,6 @@ Capybara.configure do |config|
7
7
  end
8
8
 
9
9
  Before do
10
- Card::Cache.restore
10
+ Card::Cache.reset_hard
11
+ Card::Cache.reset_soft
11
12
  end
@@ -9,6 +9,8 @@ end
9
9
  Decko.application.class.configure do
10
10
  # Settings specified here will take precedence over those in config/application.rb
11
11
 
12
+ config.view_cache = false
13
+
12
14
  config.eager_load = false
13
15
 
14
16
  # In the development environment your application's code is reloaded on
@@ -5,8 +5,6 @@ class DeckoGenerator < Rails::Generators::AppBase
5
5
 
6
6
  source_root File.expand_path("../templates", __FILE__)
7
7
 
8
- argument :deck_path, required: false
9
-
10
8
  class_option :database,
11
9
  type: :string, aliases: "-d", default: "mysql",
12
10
  desc: "Preconfigure for selected database " \
@@ -130,8 +128,9 @@ class DeckoGenerator < Rails::Generators::AppBase
130
128
  Interactive.new(options, destination_root).run
131
129
  else
132
130
  puts "Now:
133
- 1. Run `decko seed` to seed your database (see db configuration in config/database.yml).
134
- 2. Run `decko server` to start your server"
131
+ 1. Run `cd #{File.basename(destination_root)}` to move your new deck directory
132
+ 2. Run `decko seed` to seed your database (see db configuration in config/database.yml).
133
+ 3. Run `decko server` to start your server"
135
134
  end
136
135
  end
137
136
 
@@ -1,10 +1,12 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  Decko.application.routes.draw do
4
+ rel_root = Cardio.config.relative_url_root
4
5
  <% if @include_jasmine_engine %>
5
6
  if !Rails.env.production? && Object.const_defined?( :JasmineRails )
6
- mount Object.const_get(:JasmineRails).const_get(:Engine) => "<%= deck_path %>/specs"
7
+ engine = Object.const_get(:JasmineRails).const_get :Engine
8
+ mount engine => "#{rel_root}/specs"
7
9
  end
8
10
  <% end %>
9
- mount Decko::Engine => '<%= deck_path %>/'
11
+ mount Decko::Engine => "#{rel_root}/"
10
12
  end
@@ -20,7 +20,7 @@ module Decko
20
20
  elsif format.is_a?(Card::Format::FileFormat) && status == 200
21
21
  send_file(*result)
22
22
  else
23
- render body: result.html_safe,
23
+ render body: result.to_s.html_safe,
24
24
  status: status,
25
25
  content_type: format.mime_type
26
26
  end
@@ -87,8 +87,6 @@ namespace :decko do
87
87
  Rake::Task["decko:update_assets_symlink"].invoke
88
88
  end
89
89
 
90
-
91
-
92
90
  desc "set symlink for assets"
93
91
  task :update_assets_symlink do
94
92
  assets_path = File.join(Rails.public_path, "assets")
@@ -1,6 +1,8 @@
1
1
  Decko.application.routes.draw do
2
+ rel_root = Cardio.config.relative_url_root
2
3
  if !Rails.env.production? && Object.const_defined?(:JasmineRails)
3
- mount Object.const_get(:JasmineRails).const_get(:Engine) => "/specs"
4
+ engine = Object.const_get(:JasmineRails).const_get :Engine
5
+ mount engine => "#{rel_root}/specs"
4
6
  end
5
- mount Decko::Engine => "/"
7
+ mount Decko::Engine => "#{rel_root}/"
6
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decko
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-09-27 00:00:00.000000000 Z
14
+ date: 2017-10-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -33,14 +33,14 @@ dependencies:
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: '1.92'
36
+ version: 1.92.1
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: '1.92'
43
+ version: 1.92.1
44
44
  description: a wiki approach to stuctured data, dynamic interaction, and web design
45
45
  email:
46
46
  - info@decko.org