OSDN Git Service

Fixing specs & spinach since Wiki model does not exists any more
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Wed, 10 Apr 2013 20:48:40 +0000 (23:48 +0300)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Wed, 10 Apr 2013 20:48:40 +0000 (23:48 +0300)
features/dashboard/search.feature
features/steps/dashboard/dashboard_search.rb
spec/factories.rb
spec/services/notification_service_spec.rb
spec/services/project_transfer_service_spec.rb

index 9813d9d..91d870f 100644 (file)
@@ -2,13 +2,8 @@ Feature: Dashboard Search
   Background:
     Given I sign in as a user
     And I own project "Shop"
-    And Project "Shop" has wiki page "Contibuting guide"
     And I visit dashboard search page
 
   Scenario: I should see project I am looking for
     Given I search for "Sho"
     Then I should see "Shop" project link
-
-  Scenario: I should see wiki page I am looking for
-    Given I search for "Contibuting"
-    Then I should see "Contibuting guide" wiki link
\ No newline at end of file
index 9c8c879..32966a8 100644 (file)
@@ -16,15 +16,4 @@ class DashboardSearch < Spinach::FeatureSteps
     fill_in "dashboard_search", with: "Contibuting"
     click_button "Search"
   end
-
-  And 'Project "Shop" has wiki page "Contibuting guide"' do
-    @wiki_page = create :wiki,
-      project: @project,
-      title: "Contibuting guide",
-      slug: "contributing"
-  end
-
-  Then 'I should see "Contibuting guide" wiki link' do
-    page.should have_link "Contibuting guide"
-  end
 end
index 9859fbf..8f32316 100644 (file)
@@ -198,12 +198,6 @@ FactoryGirl.define do
     url
   end
 
-  factory :wiki do
-    title
-    content
-    user
-  end
-
   factory :snippet do
     project
     author
index fa47a63..21e4202 100644 (file)
@@ -1,10 +1,6 @@
 require 'spec_helper'
 
 describe NotificationService do
-  # Disable observers to prevent factory trigger notification service
-  before(:all) { ActiveRecord::Base.observers.disable :all }
-  after(:all) { ActiveRecord::Base.observers.enable :all }
-
   let(:notification) { NotificationService.new }
 
   describe 'Keys' do
index dea0b0b..7b11c97 100644 (file)
@@ -1,6 +1,8 @@
 require 'spec_helper'
 
 describe ProjectTransferService do
+  before(:each) { enable_observers }
+
   context 'namespace -> namespace' do
     let(:user) { create(:user) }
     let(:group) { create(:group) }