Skip to content

Commit

Permalink
added test for before_save callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rvalyi committed Apr 24, 2014
1 parent 8dfb635 commit 7bfb65c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/ooor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,24 @@
end
end

describe "Life cycle Callbacks" do
include Ooor

it "should call customized before_save callback" do
expect do
Ooor.xtend('ir.ui.menu') do
before_save do
raise 'before_save_called'
end
end

with_ooor_session username: 'demo', password: 'demo' do |session|
session['ir.ui.menu'].first.save
end
end.to raise_error(RuntimeError, /before_save_called/)
end
end

describe "ARel emulation" do
it "should have an 'all' method" do
ResUsers.all.should be_kind_of(Array)
Expand Down

0 comments on commit 7bfb65c

Please sign in to comment.