adds admin submit button helper

This commit is contained in:
rgarcia
2016-09-25 10:21:34 +02:00
parent 0795da02d8
commit 04c58135ee
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
require 'rails_helper'
describe AdminHelper do
describe "#admin_submit_action" do
it "returns new when the the resource has not been persisted" do
poll = build(:poll)
expect(admin_submit_action(poll)).to eq("new")
end
it "returns edit when the the resource has been persisted" do
poll = create(:poll)
expect(admin_submit_action(poll)).to eq("edit")
end
end
end