Skip to content

Commit

Permalink
Unit test for 'flash' method
Browse files Browse the repository at this point in the history
  • Loading branch information
JaniJegoroff committed Feb 28, 2015
1 parent ec08e21 commit 812dfd9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/spec_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,25 @@ class SpecBase < Minitest::Spec
$uiquery.must_equal("#{klass.class_name} marked:'myId'")
end
end

describe "#{klass}.flash and aliases" do
it 'should call Calabash flash method with correct parameters' do
klass.flash
$uiquery.must_equal("#{klass.class_name}")
klass.f
$uiquery.must_equal("#{klass.class_name}")

klass.flash(1)
$uiquery.must_equal("#{klass.class_name} index:1")
klass.f(2)
$uiquery.must_equal("#{klass.class_name} index:2")

klass.flash('myId')
$uiquery.must_equal("#{klass.class_name} marked:'myId'")
klass.f('myId')
$uiquery.must_equal("#{klass.class_name} marked:'myId'")
end
end
end

describe 'Base.fail_if_invalid' do
Expand Down

0 comments on commit 812dfd9

Please sign in to comment.