Reusing functional tests with rails 4

With rails 4, I have this test for one controller:

class Merchant::RegistrationsControllerTest < ActionController::TestCase
test “should create new registration” do
user = FactoryGirl.build(:merchant_user)
#rest of the test using user as input for the controler
end

test “should not create new registration” do
user = FactoryGirl.build(:merchant_user)
#rest of the test using user as input for the controler
endend

And this other test for other controller:

class FrontStore::RegistrationsControllerTest <
ActionController::TestCase
test “should create new registration” do
user = FactoryGirl.build(:front_store_user)
#rest of the test using user as input for the controler
end

test “should not create new registration” do
user = FactoryGirl.build(:front_store_user)
#rest of the test using user as input for the controler
endend

As you can see, Is violation of the DRY principle, because my tests are
the
same, but using a different fixture.

As a note, both controllers inherits from the
ApplicationRegistrationsController, that implements all the behaviour to
both Merchant::RegistrationsController and
FrontStore::RegistrationsController.

I want to run both test for each of the role (Merchant or FrontStore)
but
not repeating the test code.

My question is, how best design the test so they are reusable in this
case?

J. mp wrote in post #1115983:

I want to run both test for each of the role (Merchant or FrontStore)
but
not repeating the test code.

My question is, how best design the test so they are reusable in this
case?

IMHO you shouldn’t. Test code should be DAMP not DRY: