Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Notice rspec test, restrictions test

  • Loading branch information...
commit e97b0518661742ebf5b7de29879a1f0f511ef130 1 parent a06c219
bobqumd bobqumd authored
Showing with 43 additions and 1 deletion.
  1. +16 −0 features/restrictions.feature
  2. +27 −1 spec/models/notice_spec.rb
16 features/restrictions.feature
View
@@ -0,0 +1,16 @@
+Feature: Restrictions test
+In order to make restrictions
+As a superuser
+I want to be able to create, delete, and edit restrictions on shifts
+
+Scenario Outline: Time limit
+Given I have a time limit restriction for <hours> hours <minutes> minutes
+Given this restriction expires <expiration>
+
+
+Scenario Outline: Sub requests
+Given I have a sub request restriction for <subs> sub requests
+Given this restriction expires <expiration>
+
+Scenario Outline:
+
28 spec/models/notice_spec.rb
View
@@ -1,6 +1,32 @@
-describe Notice do
+require File.dirname(__FILE__) + '/../spec_helper'
+
+module NoticeHelper
+ def valid_notice_attributes
+ {
+ :author_id => 1,
+# :department_id => 1 ,
+ :start_time => Time.now ,
+ :end_time => nil ,
+ :for_locations => 1 ,
+ :for_location_groups => 1,
+ }
+ end
+end
+describe Notice do
+ include NoticeHelper
+ before(:each) do
+ @notice = Notice.new
+ end
+ it "should create a new instance given valid attributes" do
+ @notice.attributes = valid_notice_attributes
+ @notice.should be_valid
+ end
+
+ it "should have content" do
+ @notice.content == nil?
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.