Created
July 7, 2015 19:44
-
-
Save benlovell/a74cd9974971b3d57386 to your computer and use it in GitHub Desktop.
Lotus specs
This file contains hidden or 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
describe Web::Controllers::Books::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 hidden or 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
hurrdurr~/code/bookshelf % bundle exec rspec spec/web/controllers/books/index_spec.rb | |
. | |
Finished in 0.00112 seconds (files took 0.55421 seconds to load) | |
1 example, 0 failures |
This file contains hidden or 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
hurrdurr~/code/bookshelf % bundle exec rspec spec/web/views/books/index_spec.rb | |
. | |
Finished in 0.0015 seconds (files took 0.55361 seconds to load) | |
1 example, 0 failures |
This file contains hidden or 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
describe Web::Views::Books::Index do | |
let(:exposures) { Hash[foo: 'bar'] } | |
let(:template) { Lotus::View::Template.new('apps/web/templates/books/index.html.erb') } | |
let(:view) { described_class.new(template, exposures) } | |
let(:rendered) { view.render } | |
it 'exposes #foo' do | |
expect(view.foo).to eq exposures.fetch(:foo) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment