Skip to content

Commit

Permalink
TextualMultilabel: fix: s/values/rows.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Aug 7, 2018
1 parent a55cfb6 commit b1e034a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/textual_multilabel.rb
@@ -1,5 +1,5 @@
TextualMultilabel = Struct.new(:title, :options) do
def locals
{:title => title, :values => options[:values], :labels => options[:labels], :component => 'SimpleTable'}
{:title => title, :rows => options[:values], :labels => options[:labels], :component => 'SimpleTable'}
end
end
20 changes: 20 additions & 0 deletions spec/helpers/textual_multilabel.rb
@@ -0,0 +1,20 @@
describe TextualMultilabel do
subject do
TextualMultilabel.new(
'Ports',
:labels => ['Name', 'MAC Address'],
:values => [['foobar', 'f0:0f:ec:be:6b:08']]
)
end

context '#locals' do
it 'contains a :rows key' do
expect(subject.locals).to include(
:title => 'Ports',
:rows => [['foobar', 'f0:0f:ec:be:6b:08']],
:labels => ['Name', 'MAC Address'],
:component => 'SimpleTable'
)
end
end
end

0 comments on commit b1e034a

Please sign in to comment.