Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removes ability to create new subscription via admin panel, closes #9

  • Loading branch information...
commit 637dcfbe245e5bde54038cef423bf6bda97271d9 1 parent 18117be
@kennyadsl kennyadsl authored
View
9 app/views/spree/admin/subscriptions/index.html.erb
@@ -1,12 +1,3 @@
-<div class="toolbar" data-hook="toolbar">
- <ul class="actions">
- <li id="new_subscription_link">
- <%= button_link_to t(:new_subscription), new_object_url, { :icon => 'add', :id => 'admin_new_subscription' } %>
- </li>
- </ul>
- <br class="clear" />
-</div>
-
<h1><%= t("listing_subscriptions") %></h1>
<table class="index" id="listing_subscriptions">
View
47 spec/requests/admin/subscription_spec.rb
@@ -9,56 +9,9 @@
config.default_country_id = create(:country).id
end
create(:state, :country_id => 1)
- end
-
- before(:each) do
visit spree.admin_path
end
- context "listing subscriptions" do
- context "sorting" do
- # sort by subscription fields
- end
- end
-
- context "searching subscriptions" do
- # search by some fields
- end
-
- context "creating a new subscription" do
- before(:each) do
- create(:product, :name => 'sport magazine', :available_on => '2011-01-06 18:21:13:', :subscribable => true)
- create(:product, :name => 'web magazine', :available_on => '2011-01-06 18:21:13:', :subscribable => true)
- create(:product, :name => 'the book', :available_on => '2011-01-06 18:21:13:')
- click_link "Subscriptions"
- click_link "admin_new_subscription"
- end
-
- it "should have the correct fields" do
- within('#new_subscription') do
- page.should have_content('Product')
- page.should have_content('Remaining Issues')
- end
- end
-
- it "should let choose only subscribable product" do
- # this is an hack. The following line does not work!!
- # page.has_select?('Product', :with_options => ['the book'])
- page.should have_xpath("//*[@id='subscription_magazine_id']/option", :count => 2)
- end
-
- it "should be created correctly" do
- select "web magazine", :from => "Product"
- click_button "Create"
- page.should have_content("successfully created!")
- # within('table#listing_subscriptions tbody tr:nth-child(1)') { click_link("Edit") }
- within('.sidebar') { click_link("Subscription Details") }
- # hack. The following line does not work
- # page.has_select?('Product', :selected => "web magazine")
- find_field('Product').find('option[selected]').text.should == "web magazine"
- end
- end
-
context "editing a subscription" do
before(:each) do
create(:product, :name => 'sport magazine', :available_on => '2011-01-06 18:21:13:', :subscribable => true)
Please sign in to comment.
Something went wrong with that request. Please try again.