changeling 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +32 -22
- data/Rakefile +47 -0
- data/benchmarks/benchmark_setup.rake +16 -0
- data/benchmarks/changeling_benchmark.rake +34 -0
- data/benchmarks/tire_benchmark.rake +29 -0
- data/changeling.gemspec +3 -1
- data/lib/changeling.rb +10 -0
- data/lib/changeling/async/resque_worker.rb +11 -0
- data/lib/changeling/async/sidekiq_worker.rb +16 -0
- data/lib/changeling/async/trackling.rb +27 -0
- data/lib/changeling/exceptions/async_gem_required.rb +9 -0
- data/lib/changeling/probeling.rb +6 -3
- data/lib/changeling/trackling.rb +2 -0
- data/lib/changeling/version.rb +1 -1
- data/spec/controllers/blameling_integration_spec.rb +79 -0
- data/spec/fixtures/app/application.rb +0 -5
- data/spec/fixtures/app/models/async_blog_post.rb +10 -0
- data/spec/fixtures/app/models/async_blog_post_active_record.rb +5 -0
- data/spec/fixtures/app/models/async_blog_post_no_timestamp.rb +9 -0
- data/spec/lib/changeling/async/trackling_spec.rb +126 -0
- data/spec/lib/changeling/models/logling_spec.rb +213 -213
- data/spec/lib/changeling/probeling_spec.rb +25 -25
- data/spec/lib/changeling/trackling_spec.rb +22 -20
- data/spec/spec_helper.rb +21 -5
- metadata +139 -38
- data/spec/controllers/blameling_controller_spec.rb +0 -20
- data/spec/controllers/blog_posts_controller_spec.rb +0 -20
- data/spec/controllers/current_account_controller_spec.rb +0 -20
- data/spec/controllers/no_current_user_controller_spec.rb +0 -20
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RailsApp do
|
4
|
-
controller(RailsApp::BlamelingController) do
|
5
|
-
extend(RSpec::Rails::ControllerExampleGroup::BypassRescue)
|
6
|
-
end
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
# Request needs to be setup to avoid path setting error
|
10
|
-
@request = ActionController::TestRequest.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should set current_user if Blameling is included" do
|
14
|
-
Thread.new {
|
15
|
-
post :create
|
16
|
-
# Look in application.rb for the User class and it's id method.
|
17
|
-
BlogPost.last.all_history.last.modified_by.should == 33
|
18
|
-
}.join
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RailsApp do
|
4
|
-
controller(RailsApp::BlogPostsController) do
|
5
|
-
extend(RSpec::Rails::ControllerExampleGroup::BypassRescue)
|
6
|
-
end
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
# Request needs to be setup to avoid path setting error
|
10
|
-
@request = ActionController::TestRequest.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should not set current_user if Blameling is not included" do
|
14
|
-
Thread.new {
|
15
|
-
post :create
|
16
|
-
# Look in application.rb for the User class and it's id method.
|
17
|
-
BlogPost.last.all_history.last.modified_by.should == nil
|
18
|
-
}.join
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RailsApp do
|
4
|
-
controller(RailsApp::CurrentAccountController) do
|
5
|
-
extend(RSpec::Rails::ControllerExampleGroup::BypassRescue)
|
6
|
-
end
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
# Request needs to be setup to avoid path setting error
|
10
|
-
@request = ActionController::TestRequest.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should not set current_user if current_user is not defined" do
|
14
|
-
Thread.new {
|
15
|
-
post :create
|
16
|
-
# Look in application.rb for the User class and it's id method.
|
17
|
-
BlogPost.last.all_history.last.modified_by.should == 88
|
18
|
-
}.join
|
19
|
-
end
|
20
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe RailsApp do
|
4
|
-
controller(RailsApp::NoCurrentUserController) do
|
5
|
-
extend(RSpec::Rails::ControllerExampleGroup::BypassRescue)
|
6
|
-
end
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
# Request needs to be setup to avoid path setting error
|
10
|
-
@request = ActionController::TestRequest.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should not set current_user if current_user is not defined" do
|
14
|
-
Thread.new {
|
15
|
-
post :create
|
16
|
-
# Look in application.rb for the User class and it's id method.
|
17
|
-
BlogPost.last.all_history.last.modified_by.should == nil
|
18
|
-
}.join
|
19
|
-
end
|
20
|
-
end
|