Files
grecia/spec/helpers/admin_helper_spec.rb
2019-02-15 11:40:39 +01:00

19 lines
410 B
Ruby

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