-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create simple action for displaying all contributors
- Loading branch information
1 parent
41fc1b1
commit 12cb5e7
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module Web::Controllers::Contributors | ||
class Index | ||
include Web::Action | ||
|
||
def call(params) | ||
end | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Web::Views::Contributors | ||
class Index | ||
include Web::View | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require_relative '../../../../apps/web/controllers/contributors/index' | ||
|
||
RSpec.describe Web::Controllers::Contributors::Index do | ||
let(:action) { described_class.new } | ||
let(:params) { Hash[] } | ||
|
||
it 'is successful' do | ||
response = action.call(params) | ||
expect(response[0]).to eq 200 | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require_relative '../../../../apps/web/views/contributors/index' | ||
|
||
RSpec.describe Web::Views::Contributors::Index do | ||
let(:exposures) { Hash[foo: 'bar'] } | ||
let(:template) { Hanami::View::Template.new('apps/web/templates/contributors/index.html.slim') } | ||
let(:view) { described_class.new(template, exposures) } | ||
let(:rendered) { view.render } | ||
|
||
it 'exposes #foo' do | ||
pending 'This is an auto-generated test. Edit it and add your own tests.' | ||
|
||
# Example | ||
expect(view.foo).to eq exposures.fetch(:foo) | ||
end | ||
end |