Browse files

Start converting cuke feature to rspec.

  • Loading branch information...
1 parent 4ae93c9 commit 002dd064f33b74732d3ca9354328b37b6ee743a5 @ugisozols ugisozols committed Aug 29, 2011
View
19 generators/lib/generators/refinery/engine/templates/spec/requests/manage_plural_name_spec.rb
@@ -0,0 +1,19 @@
+require "spec_helper"
+
+describe "manage <%= plural_name %>" do
+ login_refinery_user
+<% if (title = attributes.detect { |a| a.type.to_s == "string" }).present? %>
+ describe "<%= plural_name %> list" do
+ before(:each) do
+ Factory(:<%= singular_name %>, :<%= title.name %> => "UniqueTitleOne")
+ Factory(:<%= singular_name %>, :<%= title.name %> => "UniqueTitleTwo")
+ end
+
+ it "shows two items" do
+ visit refinery_admin_<%= plural_name %>_path
+ page.should have_content("UniqueTitleOne")
+ page.should have_content("UniqueTitleTwo")
+ end
+ end
+<% end %>
+end
View
5 generators/lib/generators/refinery/engine/templates/spec/support/refinery/factories.rb
@@ -0,0 +1,5 @@
+FactoryGirl.define do
+ factory :<%= singular_name %>, :class => Refinery::<%= class_name %> do
+ sequence(:<%= title.name %>) { |n| "title#{n}" }
+ end
+end

0 comments on commit 002dd06

Please sign in to comment.