Improving generator controller code

By switching to it_behaves_like, the rspec failures are more friendly
for troubleshooting.

[skip ci]