Skip to content

Commit

Permalink
[C] Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeradriel committed Sep 5, 2016
1 parent b84b753 commit d0d8fa7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/timeline_rails/view_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module ViewHelpers

def timeline_wrapper(&block)
output = '<div class="timeline">'
output << capture(&block)
output << capture(&block) if block_given?
output << '</div>'
raw(output)
end
Expand Down
Binary file removed spec/internal/db/combustion_test.sqlite
Binary file not shown.
13 changes: 13 additions & 0 deletions spec/timeline_rails/helpers/view_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def count_substrings(str, sub)
end

describe TimelineRails::ViewHelpers, type: :helper do
include ActionView::Helpers
include TimelineRails::ViewHelpers

describe '#timeline_block' do
Expand All @@ -28,4 +29,16 @@ def count_substrings(str, sub)
end
end
end

describe '#timeline_wrapper' do
context 'when no block provided' do
subject { timeline_wrapper }

it 'has one timeline tag' do
expect(count_substrings(subject, '<div class="timeline">')).to eq 1
end

#TODO: Add check of yield
end
end
end

0 comments on commit d0d8fa7

Please sign in to comment.