OSDN Git Service

t#30322:create provider license import func
[pettanr/pettanr.git] / spec / controllers / licenses_controller_spec.rb
index 0627afb..8085a25 100644 (file)
@@ -8,7 +8,7 @@ describe LicensesController do
     @lg = FactoryGirl.create :license_group
     @sp = FactoryGirl.create :system_picture
     @user = FactoryGirl.create( :user_yas)
-    @author = @user.author
+    @author = FactoryGirl.create :author, :user_id => @user.id
     @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
   end
 
@@ -18,7 +18,7 @@ describe LicensesController do
       sign_in @user
       License.stub(:list).and_return([@l, @l, @l])
     end
-      context 'つつがなく終わるとき' do
+    context 'つつがなく終わるとき' do
       it 'ステータスコード200 OKを返す' do
         get :index
         response.should be_success 
@@ -109,8 +109,8 @@ describe LicensesController do
           get :show, :id => @l.id, :format => :json
           json = JSON.parse response.body
           json["name"].should match(/peta/)
-          json["caption"].should_not be_nil\r
-          json["url"].should_not be_nil\r
+          json["caption"].should_not be_nil
+          json["url"].should_not be_nil
         end
       end
     end