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.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +12 -0
  3. data/CHANGELOG.md +19 -0
  4. data/Gemfile +2 -0
  5. data/README.md +58 -7
  6. data/decent_exposure.gemspec +16 -16
  7. data/gemfiles/Gemfile.rails-4.2.0 +5 -0
  8. data/gemfiles/Gemfile.rails-4.2.6 +5 -0
  9. data/gemfiles/Gemfile.rails-5.0.0 +5 -0
  10. data/lib/decent_exposure.rb +12 -5
  11. data/lib/decent_exposure/attribute.rb +0 -1
  12. data/lib/decent_exposure/behavior.rb +1 -1
  13. data/lib/decent_exposure/context.rb +2 -2
  14. data/lib/decent_exposure/controller.rb +4 -4
  15. data/lib/decent_exposure/exposure.rb +24 -23
  16. data/lib/decent_exposure/flow.rb +1 -2
  17. data/lib/decent_exposure/mailer.rb +15 -0
  18. data/lib/decent_exposure/version.rb +1 -1
  19. data/lib/generators/decent_exposure/USAGE +13 -0
  20. data/lib/generators/decent_exposure/scaffold_templates_generator.rb +46 -0
  21. data/lib/generators/decent_exposure/templates/_form.html.erb +34 -0
  22. data/lib/generators/decent_exposure/templates/_form.html.haml +15 -0
  23. data/lib/generators/decent_exposure/templates/controller.rb +41 -0
  24. data/lib/generators/decent_exposure/templates/edit.html.erb +6 -0
  25. data/lib/generators/decent_exposure/templates/edit.html.haml +7 -0
  26. data/lib/generators/decent_exposure/templates/index.html.erb +31 -0
  27. data/lib/generators/decent_exposure/templates/index.html.haml +25 -0
  28. data/lib/generators/decent_exposure/templates/new.html.erb +5 -0
  29. data/lib/generators/decent_exposure/templates/new.html.haml +5 -0
  30. data/lib/generators/decent_exposure/templates/show.html.erb +11 -0
  31. data/lib/generators/decent_exposure/templates/show.html.haml +11 -0
  32. data/spec/{controller_spec.rb → decent_exposure/controller_spec.rb} +45 -39
  33. data/spec/features/api_birds_controller_spec.rb +70 -0
  34. data/spec/features/birds_controller_spec.rb +70 -0
  35. data/spec/features/birds_mailer_spec.rb +54 -0
  36. data/spec/generators/decent_exposure/scaffold_templates_generator_spec.rb +45 -0
  37. data/spec/support/rails_app.rb +39 -7
  38. metadata +57 -35
  39. data/hashrocket_logo.png +0 -0
  40. data/spec/integration_spec.rb +0 -26
Binary file
@@ -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