decent_exposure 3.0.0.beta1 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +12 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +2 -0
- data/README.md +58 -7
- data/decent_exposure.gemspec +16 -16
- data/gemfiles/Gemfile.rails-4.2.0 +5 -0
- data/gemfiles/Gemfile.rails-4.2.6 +5 -0
- data/gemfiles/Gemfile.rails-5.0.0 +5 -0
- data/lib/decent_exposure.rb +12 -5
- data/lib/decent_exposure/attribute.rb +0 -1
- data/lib/decent_exposure/behavior.rb +1 -1
- data/lib/decent_exposure/context.rb +2 -2
- data/lib/decent_exposure/controller.rb +4 -4
- data/lib/decent_exposure/exposure.rb +24 -23
- data/lib/decent_exposure/flow.rb +1 -2
- data/lib/decent_exposure/mailer.rb +15 -0
- data/lib/decent_exposure/version.rb +1 -1
- data/lib/generators/decent_exposure/USAGE +13 -0
- data/lib/generators/decent_exposure/scaffold_templates_generator.rb +46 -0
- data/lib/generators/decent_exposure/templates/_form.html.erb +34 -0
- data/lib/generators/decent_exposure/templates/_form.html.haml +15 -0
- data/lib/generators/decent_exposure/templates/controller.rb +41 -0
- data/lib/generators/decent_exposure/templates/edit.html.erb +6 -0
- data/lib/generators/decent_exposure/templates/edit.html.haml +7 -0
- data/lib/generators/decent_exposure/templates/index.html.erb +31 -0
- data/lib/generators/decent_exposure/templates/index.html.haml +25 -0
- data/lib/generators/decent_exposure/templates/new.html.erb +5 -0
- data/lib/generators/decent_exposure/templates/new.html.haml +5 -0
- data/lib/generators/decent_exposure/templates/show.html.erb +11 -0
- data/lib/generators/decent_exposure/templates/show.html.haml +11 -0
- data/spec/{controller_spec.rb → decent_exposure/controller_spec.rb} +45 -39
- data/spec/features/api_birds_controller_spec.rb +70 -0
- data/spec/features/birds_controller_spec.rb +70 -0
- data/spec/features/birds_mailer_spec.rb +54 -0
- data/spec/generators/decent_exposure/scaffold_templates_generator_spec.rb +45 -0
- data/spec/support/rails_app.rb +39 -7
- metadata +57 -35
- data/hashrocket_logo.png +0 -0
- data/spec/integration_spec.rb +0 -26
data/hashrocket_logo.png
DELETED
Binary file
|
data/spec/integration_spec.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "support/rails_app"
|
3
|
-
require "rspec/rails"
|
4
|
-
|
5
|
-
describe BirdsController, type: :controller do
|
6
|
-
context "finds bird by id" do
|
7
|
-
let(:mockingbird){ double("Bird") }
|
8
|
-
before{ expect(Bird).to receive(:find).with("mockingbird").once.and_return(mockingbird) }
|
9
|
-
after{ expect(controller.bird).to eq(mockingbird) }
|
10
|
-
|
11
|
-
it "finds model by id" do
|
12
|
-
get :show, params: { id: "mockingbird" }
|
13
|
-
end
|
14
|
-
|
15
|
-
it "finds model by bird_id" do
|
16
|
-
get :show, params: { bird_id: "mockingbird" }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
it "builds bird if id is not provided" do
|
21
|
-
bird = double("Bird")
|
22
|
-
expect(Bird).to receive(:new).and_return(bird)
|
23
|
-
get :show
|
24
|
-
expect(controller.bird).to eq(bird)
|
25
|
-
end
|
26
|
-
end
|