heimdallr-resource 1.0.3 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -2
- data/CHANGELOG.md +9 -0
- data/README.md +9 -5
- data/heimdallr-resource.gemspec +4 -3
- data/lib/heimdallr-resource.rb +2 -0
- data/lib/heimdallr/resource.rb +21 -191
- data/lib/heimdallr/resource_implementation.rb +190 -0
- data/spec/{resource_spec.rb → controllers/entities_controller_spec.rb} +25 -7
- data/spec/controllers/fluffies_controller_spec.rb +20 -0
- data/spec/controllers/things_controller_spec.rb +31 -0
- data/spec/dummy/app/controllers/{entity_controller.rb → entities_controller.rb} +6 -2
- data/spec/dummy/app/controllers/things_controller.rb +29 -0
- data/spec/dummy/app/models/entity.rb +2 -0
- data/spec/dummy/app/models/thing.rb +16 -0
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/routes.rb +6 -5
- data/spec/dummy/db/schema.rb +5 -0
- data/spec/models/resource_implementation_spec.rb +382 -0
- data/spec/models/resource_spec.rb +91 -0
- data/spec/spec_helper.rb +1 -0
- metadata +44 -48
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/config/environments/development.rb +0 -23
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -10
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -26
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/fluffies_spec.rb +0 -22
File without changes
|
File without changes
|
data/spec/dummy/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
data/spec/fluffies_spec.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe FluffiesController, :type => :controller do
|
4
|
-
before(:all) do
|
5
|
-
@john = User.create! :admin => false
|
6
|
-
@maria = User.create! :admin => false
|
7
|
-
@admin = User.create! :admin => true
|
8
|
-
@private = Entity.create! :name => 'ent1', :public => false
|
9
|
-
@public = Entity.create! :name => 'ent1', :public => true, :owner_id => @john.id
|
10
|
-
end
|
11
|
-
|
12
|
-
after(:all) do
|
13
|
-
Entity.delete_all
|
14
|
-
end
|
15
|
-
|
16
|
-
it "accepts load_and_authorize_resource params" do
|
17
|
-
User.mock @admin
|
18
|
-
get :index
|
19
|
-
|
20
|
-
assigns(:entities).count.should == 2
|
21
|
-
end
|
22
|
-
end
|