decko 0.3.3 → 0.3.4
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 +4 -4
- data/lib/decko/generators/decko/templates/Gemfile +1 -0
- metadata +5 -109
- data/.rspec +0 -4
- data/Guardfile +0 -32
- data/decko.gemspec +0 -42
- data/features/attach.feature +0 -85
- data/features/autonaming.feature +0 -19
- data/features/conflict.feature +0 -41
- data/features/follow.feature +0 -64
- data/features/history.feature +0 -27
- data/features/layouts.feature +0 -25
- data/features/navbox.feature +0 -34
- data/features/notifications.feature +0 -33
- data/features/paging.feature +0 -34
- data/features/pointer_inputs.feature +0 -81
- data/features/presetting_content.feature +0 -13
- data/features/reference.feature +0 -26
- data/features/reset_password.feature +0 -35
- data/features/rules.feature +0 -45
- data/features/setup.feature +0 -32
- data/features/signup.feature +0 -61
- data/features/step_definitions/decko_steps.rb +0 -532
- data/features/step_definitions/email_steps.rb +0 -216
- data/features/step_definitions/history_steps.rb +0 -5
- data/features/step_definitions/web_steps.rb +0 -155
- data/features/step_definitions/window_steps.rb +0 -27
- data/features/structure.feature +0 -41
- data/features/support/debugger.rb +0 -44
- data/features/support/delayed_job.rb +0 -20
- data/features/support/env.rb +0 -115
- data/features/support/file.txt +0 -1
- data/features/support/image.png +0 -0
- data/features/support/image2.jpg +0 -0
- data/features/support/paths.rb +0 -63
- data/features/support/scopes.rb +0 -34
- data/features/support/wagn_env.rb +0 -11
- data/features/table_of_contents.feature +0 -36
- data/features/toolbar.feature +0 -29
- data/features/update_includers.feature +0 -75
- data/lib/decko/tasks/.gitkeep +0 -0
- data/spec/controllers/card_controller_spec.rb +0 -407
- data/spec/controllers/location_spec.rb +0 -25
- data/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/javascripts/helpers/jasmine-jquery.js +0 -812
- data/spec/javascripts/support/jasmine.yml.erb +0 -79
- data/spec/javascripts/support/jasmine_config.rb +0 -21
- data/spec/javascripts/support/jasmine_runner.rb +0 -21
- data/spec/javascripts/wagn_spec.coffee +0 -42
- data/test/1.10.0-data-dump.sql +0 -359
- data/test/performance/card_create_test.rb +0 -21
- data/test/performance/fetch_test.rb +0 -9
- data/test/performance/homepage_test.rb +0 -9
- data/test/performance/render_test.rb +0 -10
- data/test/script/run_engine_deck.sh +0 -47
- data/test/script/run_mig.sh +0 -29
- data/test/test_helper.rb +0 -125
@@ -1,21 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require "test_helper"
|
3
|
-
require "rails/performance_test_help"
|
4
|
-
|
5
|
-
class CardCreateTest < ActionDispatch::PerformanceTest
|
6
|
-
def initialize *args
|
7
|
-
@name = "CardA"
|
8
|
-
super *args
|
9
|
-
Card::Auth.as Card::WagnBotID
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_card_create_simple
|
13
|
-
Card.create name: @name, content: "test content"
|
14
|
-
@name = @name.next
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_card_create_links
|
18
|
-
Card.create name: @name, content: "test [[CardA]]"
|
19
|
-
@name = @name.next
|
20
|
-
end
|
21
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
require "test_helper"
|
3
|
-
require "rails/performance_test_help"
|
4
|
-
|
5
|
-
class RenderTest < ActionDispatch::PerformanceTest
|
6
|
-
Card
|
7
|
-
def render_test
|
8
|
-
Card.new(name: "hi", content: "{{+plus1}} {{+plus2}} {{+plus3}}" .format).render! :core
|
9
|
-
end
|
10
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
VER=1.15.pre
|
4
|
-
DATABASE=mysql
|
5
|
-
RVER=3.2.16
|
6
|
-
DBCFG=../database.yml.local2
|
7
|
-
#SEEDSQL=../rdummy_test.sql
|
8
|
-
GEMFILE=../Gemfile.eng_deck
|
9
|
-
RAKEFILE=../Rakefile.eng_deck
|
10
|
-
APPLICATION=../application_rb.eng_deck
|
11
|
-
REPO_DIR=`pwd`
|
12
|
-
TEST_WORK=${REPO_DIR}/test_work
|
13
|
-
cd wagn/
|
14
|
-
gem build wagn.gemspec
|
15
|
-
mv *.gem ${REPO_DIR}/card/
|
16
|
-
cd ${REPO_DIR}/decko-rails
|
17
|
-
gem build decko.gemspec
|
18
|
-
mv *.gem ${REPO_DIR}/card/
|
19
|
-
cd ${REPO_DIR}/card
|
20
|
-
gem build card.gemspec
|
21
|
-
gem install *-${VER}.gem
|
22
|
-
cd $TEST_WORK
|
23
|
-
bundle exec rails -v
|
24
|
-
echo Generate a rails app
|
25
|
-
bundle exec rails new test_wagn_rails --skip-bundle --database=$DATABASE
|
26
|
-
cd test_wagn_rails
|
27
|
-
echo "Diff config (should only show necessary edits after rails new above)"
|
28
|
-
diff ${GEMFILE} Gemfile
|
29
|
-
#diff ${RAKEFILE} Rakefile
|
30
|
-
#diff ${APPLICATION} config/application.rb
|
31
|
-
echo "Add config"
|
32
|
-
cp ${GEMFILE} Gemfile
|
33
|
-
echo "bundle install"
|
34
|
-
bundle install
|
35
|
-
# load seed db (customize to your database.yml)
|
36
|
-
#echo "Load seed db (enter the pw)"
|
37
|
-
#mysql -u decko_user -p mdummy_test < ${SEEDSQL}
|
38
|
-
# copy db config (populate .local with you user/pw)
|
39
|
-
cp ${DBCFG} config/database.yml
|
40
|
-
RAILS_ENV=test bundle exec rake db:create --trace
|
41
|
-
echo "seed database"
|
42
|
-
RAILS_ENV=test bundle exec rake wagn:seed --trace
|
43
|
-
#echo "migrating"
|
44
|
-
#RAILS_ENV=test bundle exec rake db:migrate --trace
|
45
|
-
#RAILS_ENV=test bundle exec rake wagn:migrate --trace
|
46
|
-
#RAILS_ENV=development bundle exec rake db:migrate --trace
|
47
|
-
#RAILS_ENV=development bundle exec rake wagn:migrate --trace
|
data/test/script/run_mig.sh
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
VER=1.15.pre
|
4
|
-
DBCFG=../database.yml.local
|
5
|
-
SEEDSQL=../mdummy_test.sql
|
6
|
-
cd wagn/
|
7
|
-
gem build wagn.gemspec
|
8
|
-
mv *.gem ../card/
|
9
|
-
cd ../decko-rails
|
10
|
-
gem build decko.gemspec
|
11
|
-
mv *.gem ../card/
|
12
|
-
cd ../card
|
13
|
-
gem build card.gemspec
|
14
|
-
gem install *-${VER}.gem
|
15
|
-
cd ../test_work
|
16
|
-
rbenv which wagn
|
17
|
-
echo Generate a wagn app
|
18
|
-
wagn new test_wagn_app -c --gem-path='../../'
|
19
|
-
cd test_wagn_app
|
20
|
-
# load seed db (customize to your database.yml)
|
21
|
-
echo "Load seed db (enter the pw)"
|
22
|
-
mysql -u decko_user -p mdummy_test < ${SEEDSQL}
|
23
|
-
# copy db config (populate .local with you user/pw)
|
24
|
-
cp ${DBCFG} config/database.yml
|
25
|
-
echo "migrating"
|
26
|
-
#RAILS_ENV=test bundle exec rake db:migrate --trace
|
27
|
-
RAILS_ENV=test bundle exec rake wagn:migrate --trace
|
28
|
-
#RAILS_ENV=development bundle exec rake db:migrate --trace
|
29
|
-
#RAILS_ENV=development bundle exec rake wagn:migrate --trace
|
data/test/test_helper.rb
DELETED
@@ -1,125 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
ENV["RAILS_ENV"] = "test"
|
3
|
-
require File.expand_path("../../lib/decko/environment", __FILE__)
|
4
|
-
require "rails/test_help"
|
5
|
-
require "pathname"
|
6
|
-
|
7
|
-
unless defined? TEST_ROOT
|
8
|
-
TEST_ROOT = Pathname.new(File.expand_path(File.dirname(__FILE__))).cleanpath(true).to_s
|
9
|
-
|
10
|
-
class ActiveSupport::TestCase
|
11
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
12
|
-
#
|
13
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
14
|
-
# -- they do not yet inherit this setting
|
15
|
-
# fixtures :all
|
16
|
-
|
17
|
-
# Add more helper methods to be used by all tests here...
|
18
|
-
|
19
|
-
# Transactional fixtures accelerate your tests by wrapping each test method
|
20
|
-
# in a transaction that's rolled back on completion. This ensures that the
|
21
|
-
# test database remains unchanged so your fixtures don't have to be reloaded
|
22
|
-
# between every test method. Fewer database queries means faster tests.
|
23
|
-
#
|
24
|
-
# Read Mike Clark's excellent walkthrough at
|
25
|
-
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
26
|
-
#
|
27
|
-
# Every Active Record database supports transactions except MyISAM tables
|
28
|
-
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
29
|
-
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
30
|
-
# is recommended.
|
31
|
-
self.use_transactional_fixtures = true
|
32
|
-
|
33
|
-
# Instantiated fixtures are slow, but give you @david where otherwise you
|
34
|
-
# would need people(:david). If you don't want to migrate your existing
|
35
|
-
# test cases which use the @david style and don't mind the speed hit (each
|
36
|
-
# instantiated fixtures translates to a database query per test method),
|
37
|
-
# then set this back to true.
|
38
|
-
self.use_instantiated_fixtures = false
|
39
|
-
|
40
|
-
def prepare_url url, cardtype
|
41
|
-
if url =~ /:id/
|
42
|
-
# find by naming convention in test data:
|
43
|
-
renames = { "layout_type" => "Layout", "search_type" => "Search" }
|
44
|
-
if card = Card["Sample #{renames[cardtype] || cardtype}"]
|
45
|
-
url.gsub!(/:id/, "~#{card.id}")
|
46
|
-
else
|
47
|
-
puts("ERROR finding 'Sample #{cardtype}'")
|
48
|
-
end
|
49
|
-
end
|
50
|
-
url
|
51
|
-
end
|
52
|
-
|
53
|
-
class << self
|
54
|
-
def test_render url, *args
|
55
|
-
RenderTest.new(self, url, *args)
|
56
|
-
end
|
57
|
-
|
58
|
-
# Class method for test helpers
|
59
|
-
def test_helper *names
|
60
|
-
names.each do |name|
|
61
|
-
name = name.to_s
|
62
|
-
name = Regexp.last_match(1) if name =~ /^(.*?)_test_helper$/i
|
63
|
-
name = name.singularize
|
64
|
-
first_time = true
|
65
|
-
begin
|
66
|
-
constant = (name.camelize + "TestHelper").constantize
|
67
|
-
class_eval { include constant }
|
68
|
-
rescue NameError
|
69
|
-
filename = "#{name}_test_helper.rb"
|
70
|
-
filepath = File.expand_path(File.join(TEST_ROOT, "helpers", filename))
|
71
|
-
require filepath if first_time
|
72
|
-
first_time = false
|
73
|
-
retry
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
alias_method :test_helpers, :test_helper
|
78
|
-
end
|
79
|
-
|
80
|
-
class RenderTest
|
81
|
-
attr_reader :title, :url, :cardtype, :user, :status, :card
|
82
|
-
def initialize test_class, url, args={}
|
83
|
-
@test_class = test_class
|
84
|
-
@url = url
|
85
|
-
|
86
|
-
args[:users] ||= { anonymous: 200 }
|
87
|
-
args[:cardtypes] ||= ["Basic"]
|
88
|
-
if args[:cardtypes] == :all
|
89
|
-
# FIXME: need a better data source for this?
|
90
|
-
# args[:cardtypes] = YAML.load_file('db/bootstrap/card_codenames.yml').
|
91
|
-
bootstrap_file = File.join(Cardio.gem_root, "db/bootstrap/cards.yml")
|
92
|
-
cardtypes = YAML.load_file(bootstrap_file).select do |p|
|
93
|
-
!%w(set setting).member?(p[1]["codename"]) &&
|
94
|
-
(card = Card[p[1]["name"]]) && card.type_id == Card::CardtypeID
|
95
|
-
end
|
96
|
-
args[:cardtypes] = cardtypes.map { |_k, v| v["codename"] }
|
97
|
-
end
|
98
|
-
|
99
|
-
args[:users].each_pair do |user, status|
|
100
|
-
user = user.to_s
|
101
|
-
current_id = user.is_a?(Integer) ? user : Card[user].id
|
102
|
-
|
103
|
-
args[:cardtypes].each do |cardtype|
|
104
|
-
next if cardtype =~ /Cardtype|UserForm|Set|Fruit|Optic|Book/
|
105
|
-
|
106
|
-
title = url.gsub(/:id/, "").tr("/", "_") + "_#{cardtype}"
|
107
|
-
login =
|
108
|
-
(current_id == Card::AnonymousID ? "" : "integration_login_as '#{user}'")
|
109
|
-
test_def = %{
|
110
|
-
def test_render_#{title}_#{user}_#{status}
|
111
|
-
#{login}
|
112
|
-
url = prepare_url('#{url}', '#{cardtype}')
|
113
|
-
get url
|
114
|
-
assert_response #{status},
|
115
|
-
"\#\{url\} as #{user} should have status #{status}"
|
116
|
-
end
|
117
|
-
}
|
118
|
-
|
119
|
-
@test_class.class_eval test_def
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|