wagn 1.18.6 → 1.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +2 -2
- data/bin/wagn +3 -3
- data/features/notifications.feature +1 -0
- data/features/rules.feature +2 -0
- data/features/step_definitions/email_steps.rb +10 -2
- data/features/step_definitions/history_steps.rb +1 -1
- data/features/step_definitions/wagn_steps.rb +72 -48
- data/features/step_definitions/web_steps.rb +12 -12
- data/features/step_definitions/window_steps.rb +3 -3
- data/features/structure.feature +1 -0
- data/features/support/delayed_job.rb +18 -0
- data/features/support/env.rb +43 -24
- data/features/support/paths.rb +4 -4
- data/features/support/scopes.rb +6 -6
- data/features/support/wagn_env.rb +2 -2
- data/features/table_of_contents.feature +1 -0
- data/features/update_includers.feature +2 -4
- data/lib/decko/engine.rb +29 -28
- data/lib/wagn.rb +1 -1
- data/lib/wagn/all.rb +1 -1
- data/lib/wagn/application.rb +9 -9
- data/lib/wagn/cli.rb +5 -5
- data/lib/wagn/commands.rb +48 -48
- data/lib/wagn/commands/application.rb +4 -4
- data/lib/wagn/config/environments/cucumber.rb +2 -0
- data/lib/wagn/config/environments/development.rb +2 -2
- data/lib/wagn/config/environments/production.rb +2 -2
- data/lib/wagn/config/environments/test.rb +12 -3
- data/lib/wagn/config/initializers/secret_token.rb +2 -2
- data/lib/wagn/generators/wagn/templates/Gemfile +38 -51
- data/lib/wagn/generators/wagn/templates/bin/spring +6 -6
- data/lib/wagn/generators/wagn/templates/config/application.rb +12 -1
- data/lib/wagn/generators/wagn/templates/spec/javascripts/support/deck_jasmine.yml +2 -2
- data/lib/wagn/generators/wagn/templates/spec/javascripts/support/wagn_jasmine.yml +15 -10
- data/lib/wagn/generators/wagn/templates/spec/spec_helper.rb +1 -1
- data/lib/wagn/generators/wagn/wagn_generator.rb +87 -87
- data/lib/wagn/generators/wagn/wagn_generator/interactive.rb +28 -28
- data/lib/wagn/mods_spec_helper.rb +9 -9
- data/lib/wagn/parser.rb +27 -27
- data/lib/wagn/response.rb +106 -0
- data/lib/wagn/script_wagn_loader.rb +4 -4
- data/lib/wagn/simplecov_helper.rb +19 -19
- data/lib/wagn/tasks/cucumber.rake +19 -19
- data/lib/wagn/tasks/db.rake +8 -8
- data/lib/wagn/tasks/test.rake +25 -25
- data/lib/wagn/tasks/wagn.rake +107 -110
- data/rails/application-routes.rb +2 -2
- data/rails/controllers/card_controller.rb +37 -196
- data/rails/engine-routes.rb +29 -29
- data/script/autospec +3 -3
- data/script/rails +3 -3
- data/script/test_filter +2 -2
- data/script/wagn +3 -3
- data/spec/controllers/card_controller_spec.rb +194 -170
- data/spec/controllers/location_spec.rb +10 -10
- data/spec/javascripts/support/jasmine.yml.erb +4 -4
- data/spec/javascripts/support/jasmine_config.rb +4 -4
- data/spec/javascripts/support/jasmine_runner.rb +5 -5
- data/test/performance/card_create_test.rb +5 -5
- data/test/performance/fetch_test.rb +3 -3
- data/test/performance/homepage_test.rb +3 -3
- data/test/performance/render_test.rb +3 -3
- data/test/test_helper.rb +14 -14
- data/wagn.gemspec +16 -16
- metadata +7 -5
@@ -2,24 +2,24 @@
|
|
2
2
|
|
3
3
|
# FIXME: - this shouldn't really be with the controller specs
|
4
4
|
|
5
|
-
describe CardController,
|
5
|
+
describe CardController, "location test from old integration" do
|
6
6
|
routes { Decko::Engine.routes }
|
7
7
|
|
8
8
|
before do
|
9
|
-
login_as
|
9
|
+
login_as "joe_user"
|
10
10
|
end
|
11
11
|
|
12
|
-
describe
|
13
|
-
it
|
14
|
-
get :read, id:
|
15
|
-
assert_equal
|
12
|
+
describe "previous location" do
|
13
|
+
it "gets updated after viewing" do
|
14
|
+
get :read, id: "Joe_User"
|
15
|
+
assert_equal "/Joe_User", Card::Env.previous_location
|
16
16
|
end
|
17
17
|
|
18
18
|
it "doesn't link to nonexistent cards" do
|
19
|
-
get :read, id:
|
20
|
-
get :read, id:
|
21
|
-
get :read, id:
|
22
|
-
assert_redirected_to
|
19
|
+
get :read, id: "Joe_User"
|
20
|
+
get :read, id: "Not_Me"
|
21
|
+
get :read, id: "*previous"
|
22
|
+
assert_redirected_to "/Joe_User"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
# - dist/**/*.js
|
12
12
|
#
|
13
13
|
src_files:
|
14
|
-
- "mod/
|
14
|
+
- "mod/machines/lib/javascript/**/*.{js,coffee}"
|
15
15
|
# stylesheets
|
16
16
|
#
|
17
17
|
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
|
@@ -24,7 +24,7 @@ src_files:
|
|
24
24
|
# - stylesheets/*.css
|
25
25
|
#
|
26
26
|
stylesheets:
|
27
|
-
- "mod/
|
27
|
+
- "mod/machines/lib/stylesheets/**/*.{css,scss}"
|
28
28
|
# helpers
|
29
29
|
#
|
30
30
|
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
|
@@ -63,7 +63,7 @@ spec_files:
|
|
63
63
|
#
|
64
64
|
# src_dir: public
|
65
65
|
#
|
66
|
-
src_dir:
|
66
|
+
src_dir:
|
67
67
|
|
68
68
|
# spec_dir
|
69
69
|
#
|
@@ -74,6 +74,6 @@ src_dir:
|
|
74
74
|
#
|
75
75
|
# spec_dir: spec/javascripts
|
76
76
|
#
|
77
|
-
spec_dir:
|
77
|
+
spec_dir:
|
78
78
|
|
79
79
|
spec_helper: "spec/javascripts/support/jasmine_helper_wagn.rb"
|
@@ -10,11 +10,11 @@ module Jasmine
|
|
10
10
|
class SpecBuilder
|
11
11
|
def declare_spec parent, spec
|
12
12
|
me = self
|
13
|
-
example_name = spec[
|
14
|
-
@spec_ids << spec[
|
15
|
-
backtrace = @example_locations[parent.description +
|
13
|
+
example_name = spec["name"]
|
14
|
+
@spec_ids << spec["id"]
|
15
|
+
backtrace = @example_locations[parent.description + " " + example_name]
|
16
16
|
parent.it example_name, {} do
|
17
|
-
me.report_spec(spec[
|
17
|
+
me.report_spec(spec["id"])
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
#-*- encoding : utf-8 -*-
|
2
|
-
$LOAD_PATH.unshift(ENV[
|
2
|
+
$LOAD_PATH.unshift(ENV["JASMINE_GEM_PATH"]) if ENV["JASMINE_GEM_PATH"] # for gem testing purposes
|
3
3
|
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__),
|
4
|
+
require "rubygems"
|
5
|
+
require "jasmine"
|
6
|
+
require "rspec"
|
7
|
+
jasmine_config_overrides = File.expand_path(File.join(File.dirname(__FILE__), "jasmine_config.rb"))
|
8
8
|
require jasmine_config_overrides if File.exist?(jasmine_config_overrides)
|
9
9
|
|
10
10
|
jasmine_config = Jasmine::Config.new
|
@@ -1,21 +1,21 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "test_helper"
|
3
|
+
require "rails/performance_test_help"
|
4
4
|
|
5
5
|
class CardCreateTest < ActionDispatch::PerformanceTest
|
6
6
|
def initialize *args
|
7
|
-
@name =
|
7
|
+
@name = "CardA"
|
8
8
|
super *args
|
9
9
|
Card::Auth.as Card::WagnBotID
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_card_create_simple
|
13
|
-
Card.create name: @name, content:
|
13
|
+
Card.create name: @name, content: "test content"
|
14
14
|
@name = @name.next
|
15
15
|
end
|
16
16
|
|
17
17
|
def test_card_create_links
|
18
|
-
Card.create name: @name, content:
|
18
|
+
Card.create name: @name, content: "test [[CardA]]"
|
19
19
|
@name = @name.next
|
20
20
|
end
|
21
21
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "test_helper"
|
3
|
+
require "rails/performance_test_help"
|
4
4
|
|
5
5
|
class FetchTest < ActionDispatch::PerformanceTest
|
6
6
|
def test_fetch
|
7
|
-
Card.fetch
|
7
|
+
Card.fetch "Home"
|
8
8
|
end
|
9
9
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "test_helper"
|
3
|
+
require "rails/performance_test_help"
|
4
4
|
|
5
5
|
class HomepageTest < ActionDispatch::PerformanceTest
|
6
6
|
def test_homepage
|
7
|
-
get
|
7
|
+
get "/"
|
8
8
|
end
|
9
9
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require
|
3
|
-
require
|
2
|
+
require "test_helper"
|
3
|
+
require "rails/performance_test_help"
|
4
4
|
|
5
5
|
class RenderTest < ActionDispatch::PerformanceTest
|
6
6
|
Card
|
7
7
|
def render_test
|
8
|
-
Card.new(name:
|
8
|
+
Card.new(name: "hi", content: "{{+plus1}} {{+plus2}} {{+plus3}}" .format).render :core
|
9
9
|
end
|
10
10
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
ENV[
|
3
|
-
require File.expand_path(
|
4
|
-
require
|
5
|
-
require
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
require File.expand_path("../../lib/wagn/environment", __FILE__)
|
4
|
+
require "rails/test_help"
|
5
|
+
require "pathname"
|
6
6
|
|
7
7
|
unless defined? TEST_ROOT
|
8
8
|
TEST_ROOT = Pathname.new(File.expand_path(File.dirname(__FILE__))).cleanpath(true).to_s
|
@@ -40,7 +40,7 @@ unless defined? TEST_ROOT
|
|
40
40
|
def prepare_url url, cardtype
|
41
41
|
if url =~ /:id/
|
42
42
|
# find by naming convention in test data:
|
43
|
-
renames = {
|
43
|
+
renames = { "layout_type" => "Layout", "search_type" => "Search" }
|
44
44
|
if card = Card["Sample #{renames[cardtype] || cardtype}"]
|
45
45
|
url.gsub!(/:id/, "~#{card.id}")
|
46
46
|
else puts("ERROR finding 'Sample #{cardtype}'") end
|
@@ -61,10 +61,10 @@ unless defined? TEST_ROOT
|
|
61
61
|
name = name.singularize
|
62
62
|
first_time = true
|
63
63
|
begin
|
64
|
-
constant = (name.camelize +
|
64
|
+
constant = (name.camelize + "TestHelper").constantize
|
65
65
|
class_eval { include constant }
|
66
66
|
rescue NameError
|
67
|
-
filename = File.expand_path(TEST_ROOT +
|
67
|
+
filename = File.expand_path(TEST_ROOT + "/helpers/" + name + "_test_helper.rb")
|
68
68
|
require filename if first_time
|
69
69
|
first_time = false
|
70
70
|
retry
|
@@ -81,15 +81,15 @@ unless defined? TEST_ROOT
|
|
81
81
|
@url = url
|
82
82
|
|
83
83
|
args[:users] ||= { anonymous: 200 }
|
84
|
-
args[:cardtypes] ||= [
|
84
|
+
args[:cardtypes] ||= ["Basic"]
|
85
85
|
if args[:cardtypes] == :all
|
86
86
|
# FIXME: need a better data source for this?
|
87
87
|
# args[:cardtypes] = YAML.load_file('db/bootstrap/card_codenames.yml').
|
88
|
-
bootstrap_file = File.join(Cardio.gem_root,
|
88
|
+
bootstrap_file = File.join(Cardio.gem_root, "db/bootstrap/cards.yml")
|
89
89
|
args[:cardtypes] = YAML.load_file(bootstrap_file).select do |p|
|
90
|
-
!%w(set setting).member?(p[1][
|
91
|
-
(card = Card[p[1][
|
92
|
-
end.map { |_k, v| v[
|
90
|
+
!%w(set setting).member?(p[1]["codename"]) &&
|
91
|
+
(card = Card[p[1]["name"]]) && card.type_id == Card::CardtypeID
|
92
|
+
end.map { |_k, v| v["codename"] }
|
93
93
|
end
|
94
94
|
|
95
95
|
args[:users].each_pair do |user, status|
|
@@ -99,8 +99,8 @@ unless defined? TEST_ROOT
|
|
99
99
|
args[:cardtypes].each do |cardtype|
|
100
100
|
next if cardtype =~ /Cardtype|UserForm|Set|Fruit|Optic|Book/
|
101
101
|
|
102
|
-
title = url.gsub(/:id/,
|
103
|
-
login = (current_id == Card::AnonymousID ?
|
102
|
+
title = url.gsub(/:id/, "").gsub(/\//, "_") + "_#{cardtype}"
|
103
|
+
login = (current_id == Card::AnonymousID ? "" : "integration_login_as '#{user}'")
|
104
104
|
test_def = %{
|
105
105
|
def test_render_#{title}_#{user}_#{status}
|
106
106
|
#{login}
|
data/wagn.gemspec
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
version = File.open(File.expand_path(
|
3
|
+
version = File.open(File.expand_path("../../card/VERSION", __FILE__)).read.chomp
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = "wagn"
|
7
7
|
s.version = version
|
8
|
-
s.authors = [
|
9
|
-
|
10
|
-
s.email = [
|
8
|
+
s.authors = ["Ethan McCutchen", "Lewis Hoffman",
|
9
|
+
"Gerry Gleason", "Philipp Kühl"]
|
10
|
+
s.email = ["info@wagn.org"]
|
11
11
|
|
12
12
|
# s.date = '2013-12-20'
|
13
|
-
s.summary =
|
14
|
-
s.description =
|
15
|
-
|
16
|
-
s.homepage =
|
17
|
-
s.licenses = [
|
13
|
+
s.summary = "structured wiki web platform"
|
14
|
+
s.description = "a wiki approach to stuctured data, dynamic interaction, "\
|
15
|
+
" and web design"
|
16
|
+
s.homepage = "http://wagn.org"
|
17
|
+
s.licenses = ["GPL-2.0", "GPL-3.0"]
|
18
18
|
|
19
19
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
20
20
|
|
21
|
-
s.bindir =
|
22
|
-
s.executables = [
|
21
|
+
s.bindir = "bin"
|
22
|
+
s.executables = ["wagn"]
|
23
23
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
24
|
-
s.require_paths = [
|
24
|
+
s.require_paths = ["lib"]
|
25
25
|
|
26
|
-
s.required_ruby_version =
|
26
|
+
s.required_ruby_version = ">= 1.9.3"
|
27
27
|
|
28
28
|
[
|
29
|
-
[
|
30
|
-
[
|
29
|
+
["rails", "~> 4.2"],
|
30
|
+
["card", version]
|
31
31
|
].each do |dep|
|
32
32
|
s.add_runtime_dependency(*dep)
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wagn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.19.0
|
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: 2016-
|
14
|
+
date: 2016-08-29 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.
|
36
|
+
version: 1.19.0
|
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.
|
43
|
+
version: 1.19.0
|
44
44
|
description: a wiki approach to stuctured data, dynamic interaction, and web design
|
45
45
|
email:
|
46
46
|
- info@wagn.org
|
@@ -99,6 +99,7 @@ files:
|
|
99
99
|
- features/step_definitions/web_steps.rb
|
100
100
|
- features/step_definitions/window_steps.rb
|
101
101
|
- features/structure.feature
|
102
|
+
- features/support/delayed_job.rb
|
102
103
|
- features/support/env.rb
|
103
104
|
- features/support/file.txt
|
104
105
|
- features/support/image.png
|
@@ -157,6 +158,7 @@ files:
|
|
157
158
|
- lib/wagn/generators/wagn/wagn_generator/interactive.rb
|
158
159
|
- lib/wagn/mods_spec_helper.rb
|
159
160
|
- lib/wagn/parser.rb
|
161
|
+
- lib/wagn/response.rb
|
160
162
|
- lib/wagn/script_wagn_loader.rb
|
161
163
|
- lib/wagn/simplecov_helper.rb
|
162
164
|
- lib/wagn/tasks/.gitkeep
|
@@ -784,6 +786,7 @@ test_files:
|
|
784
786
|
- features/step_definitions/web_steps.rb
|
785
787
|
- features/step_definitions/window_steps.rb
|
786
788
|
- features/structure.feature
|
789
|
+
- features/support/delayed_job.rb
|
787
790
|
- features/support/env.rb
|
788
791
|
- features/support/file.txt
|
789
792
|
- features/support/image.png
|
@@ -810,4 +813,3 @@ test_files:
|
|
810
813
|
- test/script/run_engine_deck.sh
|
811
814
|
- test/script/run_mig.sh
|
812
815
|
- test/test_helper.rb
|
813
|
-
has_rdoc:
|