소스 검색

Move these specs to the right splace.

Akinori MUSHA 10 년 전
부모
커밋
4a06afafde
1개의 변경된 파일16개의 추가작업 그리고 14개의 파일을 삭제
  1. 16 14
      spec/models/agent_spec.rb

+ 16 - 14
spec/models/agent_spec.rb

@@ -757,6 +757,22 @@ describe Agent do
       end
     end
   end
+
+  describe '.last_checked_event_id' do
+    it "should be updated by setting drop_pending_events to true" do
+      agent = agents(:bob_rain_notifier_agent)
+      agent.last_checked_event_id = nil
+      agent.save!
+      agent.update!(drop_pending_events: true)
+      agent.reload.last_checked_event_id.should == Event.maximum(:id)
+    end
+
+    it "should not affect a virtual attribute drop_pending_events" do
+      agent = agents(:bob_rain_notifier_agent)
+      agent.update!(drop_pending_events: true)
+      agent.reload.drop_pending_events.should == false
+    end
+  end
 end
 
 describe AgentDrop do
@@ -852,18 +868,4 @@ describe AgentDrop do
     interpolate(t, @wsa2).should eq('1: Formatter')
     interpolate(t, @efa).should eq('0: ')
   end
-
-  describe 'last_checked_event_id' do
-    it "should be updated by setting drop_pending_events to true" do
-      @wsa1.last_checked_event_id = nil
-      @wsa1.save!
-      @wsa1.update!(drop_pending_events: true)
-      @wsa1.reload.last_checked_event_id.should == Event.maximum(:id)
-    end
-
-    it "should not affect a virtual attribute drop_pending_events" do
-      @wsa1.update!(drop_pending_events: true)
-      @wsa1.reload.drop_pending_events.should == false
-    end
-  end
 end