rrjj 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +84 -0
- data/Rakefile +14 -0
- data/config/rrjj.rb +35 -0
- data/lib/guard_helpers/file_helper.rb +35 -0
- data/lib/guard_helpers/opal_helper.rb +27 -0
- data/lib/guard_helpers/rails_helper.rb +33 -0
- data/lib/guard_helpers/rrjj_helper.rb +45 -0
- data/lib/guard_helpers/srt_helper.rb +96 -0
- data/lib/rails_handlers/ctrl_handler.rb +7 -0
- data/lib/ro_commands/check.rb +16 -0
- data/lib/ro_commands/model.rb +24 -0
- data/lib/ro_commands/post_handler.rb +85 -0
- data/lib/ro_commands/rails_base.rb +27 -0
- data/lib/ro_commands/rails_shortcuts.rb +18 -0
- data/lib/ro_commands/ro_proc.rb +8 -0
- data/lib/ro_core_ext/object.rb +11 -0
- data/lib/ro_html_handler.rb +8 -0
- data/lib/rrjj.rb +18 -0
- data/lib/rrjj/cmd.rb +7 -0
- data/lib/rrjj/cmds.rb +42 -0
- data/lib/rrjj/railtie.rb +13 -0
- data/lib/rrjj/ro_faker.rb +10 -0
- data/lib/rrjj/version.rb +3 -0
- data/lib/rrjj_ro_commands_bin.rb +4 -0
- data/lib/rubymine_heaven.rb +2 -0
- data/lib/rubymine_heaven/linkable_errors.rb +56 -0
- data/lib/rubymine_heaven/linkable_errors_handler.rb +31 -0
- data/lib/rubymine_heaven/linkable_errors_railtie.rb +21 -0
- data/lib/subtitle.rb +149 -0
- data/lib/subtitles/ex.srt +5 -0
- data/lib/templates/alias.erb +3 -0
- data/lib/templates/srt.erb +4 -0
- data/spec/controllers/app_controller_spec.rb +12 -0
- data/spec/decorators/app_decorator_spec.rb +4 -0
- data/spec/decorators/post_decorator_spec.rb +38 -0
- data/spec/features/posts/index_spec.rb +9 -0
- data/spec/features/posts/search_spec.rb +10 -0
- data/spec/fixtures/handler/error_page.html +1 -0
- data/spec/fixtures/handler/result.html +1 -0
- data/spec/fixtures/post_handler/posts/error/test.md +1 -0
- data/spec/fixtures/post_handler/posts/rails/test.html +0 -0
- data/spec/fixtures/post_handler/tmp/rspec_guard_result +1 -0
- data/spec/fixtures/rails_navigate/app/controllers/app_controller.rb +0 -0
- data/spec/fixtures/rails_navigate/app/controllers/one_controller.rb +0 -0
- data/spec/fixtures/rails_navigate/app/controllers/two_controller.rb +0 -0
- data/spec/fixtures/rails_navigate/app/decorators/two_decorator.rb +0 -0
- data/spec/fixtures/rails_navigate/app/models/two_model.rb +0 -0
- data/spec/fixtures/rails_navigate/opal_lib/path/to/file.rb +0 -0
- data/spec/fixtures/rails_navigate/opal_lib/path/to/file2.rb +0 -0
- data/spec/fixtures/try/origin/ex.erb.ogv +0 -0
- data/spec/helpers/app_helper_spec.rb +15 -0
- data/spec/helpers/posts_helper_spec.rb +15 -0
- data/spec/lib/guard_helpers/rails_helper_spec.rb +1 -0
- data/spec/lib/guard_helpers/ro_helper_spec.rb +23 -0
- data/spec/lib/guard_helpers/srt_helper_spec.rb +18 -0
- data/spec/lib/ro_cells/opal_spec.rb +40 -0
- data/spec/lib/ro_commands/check_spec.rb +21 -0
- data/spec/lib/ro_commands/post_handler_spec.rb +0 -0
- data/spec/lib/ro_commands/rails_navigate_spec.rb +47 -0
- data/spec/lib/rubymine_heaven/linkable_errors_railtie_spec.rb +2 -0
- data/spec/lib/srt_helper_spec.rb +5 -0
- data/spec/lib/subtitle_spec.rb +46 -0
- data/spec/lib/templates/srt_spec.rb +2 -0
- data/spec/lib/video_spec.rb +34 -0
- data/spec/models/ln_spec.rb +5 -0
- data/spec/models/post_spec.rb +8 -0
- data/spec/models/sub_spec.rb +5 -0
- data/spec/models/tag_spec.rb +5 -0
- data/spec/models/try_spec.rb +5 -0
- data/spec/requests/posts_spec.rb +11 -0
- data/spec/routing/posts_routing_spec.rb +35 -0
- data/spec/spec_helper.rb +79 -0
- data/spec/views/app/search.html.erb_spec.rb +5 -0
- metadata +227 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Posts" do
|
4
|
+
describe "GET /posts" do
|
5
|
+
it "works! (now write some real specs)" do
|
6
|
+
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
|
7
|
+
get posts_path
|
8
|
+
response.status.should be(200)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe PostsController do
|
4
|
+
describe "routing" do
|
5
|
+
|
6
|
+
it "routes to #index" do
|
7
|
+
get("/posts").should route_to("posts#index")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "routes to #new" do
|
11
|
+
get("/posts/new").should route_to("posts#new")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "routes to #show" do
|
15
|
+
get("/posts/1").should route_to("posts#show", :id => "1")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "routes to #edit" do
|
19
|
+
get("/posts/1/edit").should route_to("posts#edit", :id => "1")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "routes to #create" do
|
23
|
+
post("/posts").should route_to("posts#create")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "routes to #update" do
|
27
|
+
put("/posts/1").should route_to("posts#update", :id => "1")
|
28
|
+
end
|
29
|
+
|
30
|
+
it "routes to #destroy" do
|
31
|
+
delete("/posts/1").should route_to("posts#destroy", :id => "1")
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'spork'
|
3
|
+
|
4
|
+
Spork.prefork do
|
5
|
+
|
6
|
+
ENV["RAILS_ENV"] ||= 'test'
|
7
|
+
require File.expand_path("../../config/environment", __FILE__)
|
8
|
+
require File.expand_path('../../config/rrjj', __FILE__)
|
9
|
+
require 'rrjj'
|
10
|
+
|
11
|
+
require 'capybara/rspec'
|
12
|
+
require 'rspec/rails'
|
13
|
+
|
14
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
15
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
16
|
+
|
17
|
+
ENV["RAILS_ENV"] ||= 'test'
|
18
|
+
require File.expand_path("../../config/environment", __FILE__)
|
19
|
+
require 'rspec/rails'
|
20
|
+
require 'draper/test/rspec_integration'
|
21
|
+
|
22
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
23
|
+
# in spec/support/ and its subdirectories.
|
24
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
25
|
+
|
26
|
+
# Checks for pending migrations before tests are run.
|
27
|
+
# If you are not using ActiveRecord, you can remove this line.
|
28
|
+
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
29
|
+
|
30
|
+
require 'ro_helpers'
|
31
|
+
require "ro_rspec_helpers"
|
32
|
+
|
33
|
+
RoSpecHelper.project_fix = ::Rrjj.fix
|
34
|
+
|
35
|
+
if RunIn.my_pc?
|
36
|
+
ENV['RUBYMINE_HOME'] = File.join(ENV['HOME'], 'Dropbox/RubyMine')
|
37
|
+
$:.unshift(File.expand_path("rb/testing/patch/common", ENV["RUBYMINE_HOME"]))
|
38
|
+
$:.unshift(File.expand_path("rb/testing/patch/bdd", ENV["RUBYMINE_HOME"]))
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
RSpec.configure do |config|
|
43
|
+
config.before(:all) do
|
44
|
+
#Headless.new.start
|
45
|
+
end
|
46
|
+
# ## Mock Framework
|
47
|
+
#
|
48
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
49
|
+
#
|
50
|
+
# config.mock_with :mocha
|
51
|
+
# config.mock_with :flexmock
|
52
|
+
# config.mock_with :rr
|
53
|
+
|
54
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
55
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
56
|
+
|
57
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
58
|
+
# examples within a transaction, remove the following line or assign false
|
59
|
+
# instead of true.
|
60
|
+
config.use_transactional_fixtures = true
|
61
|
+
|
62
|
+
# If true, the base class of anonymous controllers will be inferred
|
63
|
+
# automatically. This will be the default behavior in future versions of
|
64
|
+
# rspec-rails.
|
65
|
+
config.infer_base_class_for_anonymous_controllers = false
|
66
|
+
|
67
|
+
# Run specs in random order to surface order dependencies. If you find an
|
68
|
+
# order dependency and want to debug it, you can fix the order by providing
|
69
|
+
# the seed, which is printed after each run.
|
70
|
+
# --seed 1234
|
71
|
+
config.order = "random"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
Spork.each_run do
|
76
|
+
require 'ro_commands/post_handler'
|
77
|
+
#require 'opal'
|
78
|
+
end
|
79
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
metadata
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rrjj
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- RoRoCo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.0.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: zeus
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: github-markup
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: github-markdown
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: ''
|
84
|
+
email:
|
85
|
+
- zhuxingruo3@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- lib/ro_commands/rails_shortcuts.rb
|
91
|
+
- lib/ro_commands/post_handler.rb
|
92
|
+
- lib/ro_commands/model.rb
|
93
|
+
- lib/ro_commands/rails_base.rb
|
94
|
+
- lib/ro_commands/ro_proc.rb
|
95
|
+
- lib/ro_commands/check.rb
|
96
|
+
- lib/ro_html_handler.rb
|
97
|
+
- lib/subtitles/ex.srt
|
98
|
+
- lib/subtitle.rb
|
99
|
+
- lib/rrjj_ro_commands_bin.rb
|
100
|
+
- lib/rails_handlers/ctrl_handler.rb
|
101
|
+
- lib/rrjj/cmd.rb
|
102
|
+
- lib/rrjj/cmds.rb
|
103
|
+
- lib/rrjj/railtie.rb
|
104
|
+
- lib/rrjj/version.rb
|
105
|
+
- lib/rrjj/ro_faker.rb
|
106
|
+
- lib/rubymine_heaven/linkable_errors_railtie.rb
|
107
|
+
- lib/rubymine_heaven/linkable_errors_handler.rb
|
108
|
+
- lib/rubymine_heaven/linkable_errors.rb
|
109
|
+
- lib/rubymine_heaven.rb
|
110
|
+
- lib/guard_helpers/rails_helper.rb
|
111
|
+
- lib/guard_helpers/rrjj_helper.rb
|
112
|
+
- lib/guard_helpers/srt_helper.rb
|
113
|
+
- lib/guard_helpers/file_helper.rb
|
114
|
+
- lib/guard_helpers/opal_helper.rb
|
115
|
+
- lib/ro_core_ext/object.rb
|
116
|
+
- lib/rrjj.rb
|
117
|
+
- lib/templates/srt.erb
|
118
|
+
- lib/templates/alias.erb
|
119
|
+
- Rakefile
|
120
|
+
- README.md
|
121
|
+
- config/rrjj.rb
|
122
|
+
- spec/helpers/posts_helper_spec.rb
|
123
|
+
- spec/helpers/app_helper_spec.rb
|
124
|
+
- spec/fixtures/post_handler/tmp/rspec_guard_result
|
125
|
+
- spec/fixtures/post_handler/posts/error/test.md
|
126
|
+
- spec/fixtures/post_handler/posts/rails/test.html
|
127
|
+
- spec/fixtures/handler/result.html
|
128
|
+
- spec/fixtures/handler/error_page.html
|
129
|
+
- spec/fixtures/try/origin/ex.erb.ogv
|
130
|
+
- spec/fixtures/rails_navigate/app/models/two_model.rb
|
131
|
+
- spec/fixtures/rails_navigate/app/decorators/two_decorator.rb
|
132
|
+
- spec/fixtures/rails_navigate/app/controllers/one_controller.rb
|
133
|
+
- spec/fixtures/rails_navigate/app/controllers/two_controller.rb
|
134
|
+
- spec/fixtures/rails_navigate/app/controllers/app_controller.rb
|
135
|
+
- spec/fixtures/rails_navigate/opal_lib/path/to/file2.rb
|
136
|
+
- spec/fixtures/rails_navigate/opal_lib/path/to/file.rb
|
137
|
+
- spec/spec_helper.rb
|
138
|
+
- spec/routing/posts_routing_spec.rb
|
139
|
+
- spec/lib/ro_commands/check_spec.rb
|
140
|
+
- spec/lib/ro_commands/post_handler_spec.rb
|
141
|
+
- spec/lib/ro_commands/rails_navigate_spec.rb
|
142
|
+
- spec/lib/video_spec.rb
|
143
|
+
- spec/lib/srt_helper_spec.rb
|
144
|
+
- spec/lib/ro_cells/opal_spec.rb
|
145
|
+
- spec/lib/rubymine_heaven/linkable_errors_railtie_spec.rb
|
146
|
+
- spec/lib/guard_helpers/srt_helper_spec.rb
|
147
|
+
- spec/lib/guard_helpers/ro_helper_spec.rb
|
148
|
+
- spec/lib/guard_helpers/rails_helper_spec.rb
|
149
|
+
- spec/lib/templates/srt_spec.rb
|
150
|
+
- spec/lib/subtitle_spec.rb
|
151
|
+
- spec/views/app/search.html.erb_spec.rb
|
152
|
+
- spec/models/sub_spec.rb
|
153
|
+
- spec/models/tag_spec.rb
|
154
|
+
- spec/models/try_spec.rb
|
155
|
+
- spec/models/post_spec.rb
|
156
|
+
- spec/models/ln_spec.rb
|
157
|
+
- spec/decorators/app_decorator_spec.rb
|
158
|
+
- spec/decorators/post_decorator_spec.rb
|
159
|
+
- spec/controllers/app_controller_spec.rb
|
160
|
+
- spec/requests/posts_spec.rb
|
161
|
+
- spec/features/posts/search_spec.rb
|
162
|
+
- spec/features/posts/index_spec.rb
|
163
|
+
homepage: ''
|
164
|
+
licenses: []
|
165
|
+
metadata: {}
|
166
|
+
post_install_message:
|
167
|
+
rdoc_options: []
|
168
|
+
require_paths:
|
169
|
+
- lib
|
170
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - '>='
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - '>='
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
requirements: []
|
181
|
+
rubyforge_project:
|
182
|
+
rubygems_version: 2.0.14
|
183
|
+
signing_key:
|
184
|
+
specification_version: 4
|
185
|
+
summary: ''
|
186
|
+
test_files:
|
187
|
+
- spec/helpers/posts_helper_spec.rb
|
188
|
+
- spec/helpers/app_helper_spec.rb
|
189
|
+
- spec/fixtures/post_handler/tmp/rspec_guard_result
|
190
|
+
- spec/fixtures/post_handler/posts/error/test.md
|
191
|
+
- spec/fixtures/post_handler/posts/rails/test.html
|
192
|
+
- spec/fixtures/handler/result.html
|
193
|
+
- spec/fixtures/handler/error_page.html
|
194
|
+
- spec/fixtures/try/origin/ex.erb.ogv
|
195
|
+
- spec/fixtures/rails_navigate/app/models/two_model.rb
|
196
|
+
- spec/fixtures/rails_navigate/app/decorators/two_decorator.rb
|
197
|
+
- spec/fixtures/rails_navigate/app/controllers/one_controller.rb
|
198
|
+
- spec/fixtures/rails_navigate/app/controllers/two_controller.rb
|
199
|
+
- spec/fixtures/rails_navigate/app/controllers/app_controller.rb
|
200
|
+
- spec/fixtures/rails_navigate/opal_lib/path/to/file2.rb
|
201
|
+
- spec/fixtures/rails_navigate/opal_lib/path/to/file.rb
|
202
|
+
- spec/spec_helper.rb
|
203
|
+
- spec/routing/posts_routing_spec.rb
|
204
|
+
- spec/lib/ro_commands/check_spec.rb
|
205
|
+
- spec/lib/ro_commands/post_handler_spec.rb
|
206
|
+
- spec/lib/ro_commands/rails_navigate_spec.rb
|
207
|
+
- spec/lib/video_spec.rb
|
208
|
+
- spec/lib/srt_helper_spec.rb
|
209
|
+
- spec/lib/ro_cells/opal_spec.rb
|
210
|
+
- spec/lib/rubymine_heaven/linkable_errors_railtie_spec.rb
|
211
|
+
- spec/lib/guard_helpers/srt_helper_spec.rb
|
212
|
+
- spec/lib/guard_helpers/ro_helper_spec.rb
|
213
|
+
- spec/lib/guard_helpers/rails_helper_spec.rb
|
214
|
+
- spec/lib/templates/srt_spec.rb
|
215
|
+
- spec/lib/subtitle_spec.rb
|
216
|
+
- spec/views/app/search.html.erb_spec.rb
|
217
|
+
- spec/models/sub_spec.rb
|
218
|
+
- spec/models/tag_spec.rb
|
219
|
+
- spec/models/try_spec.rb
|
220
|
+
- spec/models/post_spec.rb
|
221
|
+
- spec/models/ln_spec.rb
|
222
|
+
- spec/decorators/app_decorator_spec.rb
|
223
|
+
- spec/decorators/post_decorator_spec.rb
|
224
|
+
- spec/controllers/app_controller_spec.rb
|
225
|
+
- spec/requests/posts_spec.rb
|
226
|
+
- spec/features/posts/search_spec.rb
|
227
|
+
- spec/features/posts/index_spec.rb
|