Fixed houndci violations
This commit is contained in:
parent
c97affca35
commit
d50fd3cc23
2 changed files with 4 additions and 9 deletions
|
|
@ -1,26 +1,21 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Admin::UsersController do
|
describe Admin::UsersController do
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@user = create(:user)
|
@user = create(:user)
|
||||||
@admin = create(:admin)
|
@admin = create(:admin)
|
||||||
sign_in(@admin)
|
sign_in(@admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "GET '#index'" do
|
describe "GET '#index'" do
|
||||||
|
|
||||||
it 'populates an array of users' do
|
it 'populates an array of users' do
|
||||||
user1 = create(:user, email:"gopesh.7500@gmail.com")
|
user1 = create(:user, email: "gopesh.7500@gmail.com")
|
||||||
user2 = create(:user,email:"gopesh@gmail.com")
|
user2 = create(:user, email: "gopesh@gmail.com")
|
||||||
get :index
|
get :index
|
||||||
# pp response.body
|
|
||||||
expect(assigns(:users)).to match_array([@user,@admin,user1,user2])
|
expect(assigns(:users)).to match_array([@user,@admin,user1,user2])
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders index template' do
|
it 'renders index template' do
|
||||||
get :index
|
get :index
|
||||||
# pp response.body
|
|
||||||
expect(response).to render_template :index
|
expect(response).to render_template :index
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :user do
|
factory :user do
|
||||||
sequence(:email) {|n|'name#{n}@example.com'}
|
sequence(:email) { |n| 'name#{n}@example.com' }
|
||||||
password 'changeme'
|
password 'changeme'
|
||||||
password_confirmation 'changeme'
|
password_confirmation 'changeme'
|
||||||
confirmed_at Time.now
|
confirmed_at Time.now
|
||||||
end
|
end
|
||||||
factory :admin, class: User do
|
factory :admin, class: User do
|
||||||
sequence(:email) {|n|'gopesh#{n}@exampleco.in'}
|
sequence(:email) { |n| 'gopesh#{n}@exampleco.in' }
|
||||||
password 'changeme'
|
password 'changeme'
|
||||||
password_confirmation 'changeme'
|
password_confirmation 'changeme'
|
||||||
confirmed_at Time.now
|
confirmed_at Time.now
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue