You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
795 B
Ruby
25 lines
795 B
Ruby
require 'spec_helper'
|
|
|
|
describe SnapshotPresenter do
|
|
let(:snapshot_presenter) { SnapshotPresenter.new(snapshot) }
|
|
let(:snapshot) { Snapshot.new([line_1, line_2]) }
|
|
let(:line_1) { double('line_1') }
|
|
let(:line_2) { double('line_2') }
|
|
let(:line_1_presenter) { double(:to_html => '<line_1>') }
|
|
let(:line_2_presenter) { double(:to_html => '<line_2>') }
|
|
|
|
describe '#to_html' do
|
|
subject { snapshot_presenter.to_html }
|
|
|
|
before do
|
|
allow(SnapshotLinePresenter).to receive(:new).with(line_1).
|
|
and_return(line_1_presenter)
|
|
allow(SnapshotLinePresenter).to receive(:new).with(line_2).
|
|
and_return(line_2_presenter)
|
|
end
|
|
|
|
it { should be_kind_of(ActiveSupport::SafeBuffer) }
|
|
it { should eq('<pre class="thumbnail"><line_1><line_2></pre>') }
|
|
end
|
|
end
|