Skip to content

Commit 84b7632

Browse files
Praveen VPraveenVignesh
authored andcommitted
fixed some style violation
more style fixes added trait for job, event factories added traits for project, style fixes, merge fixes added trait for public event
1 parent 50b386a commit 84b7632

24 files changed

+209
-207
lines changed

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ GEM
103103
factory_girl_rails (4.5.0)
104104
factory_girl (~> 4.5.0)
105105
railties (>= 3.0.0)
106-
fakeweb (1.3.0)
107106
faker (1.4.3)
108107
i18n (~> 0.5)
108+
fakeweb (1.3.0)
109109
faraday (0.8.7)
110110
multipart-post (~> 1.1)
111111
fastercsv (1.5.5)
@@ -273,8 +273,8 @@ DEPENDENCIES
273273
devise (~> 3.3.0)
274274
dotenv-rails
275275
factory_girl_rails
276-
fakeweb
277276
faker
277+
fakeweb
278278
friendly_id (~> 4.0.10)
279279
geocoder
280280
jquery-rails

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@
142142
t.datetime "updated_at", :null => false
143143
t.string "image_url"
144144
t.string "twitter", :limit => 15
145-
t.string "slug"
146145
t.string "logo_file_name"
147146
t.string "logo_content_type"
148147
t.integer "logo_file_size"
149148
t.datetime "logo_updated_at"
149+
t.string "slug"
150150
end
151151

152152
add_index "organizations", ["slug"], :name => "index_organizations_on_slug", :unique => true

spec/controllers/users_controller_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
require 'spec_helper'
1+
require "spec_helper"
22

33
describe UsersController do
44
describe "GET 'new'" do
5-
it 'returns http success' do
6-
get 'new'
5+
it "returns http success" do
6+
get "new"
77
response.should be_success
88
end
99
end

spec/factories.rb

Lines changed: 0 additions & 37 deletions
This file was deleted.

spec/factories/events.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,28 @@
1010
end_date { Time.new(2014, 10, 31) }
1111
end
1212
end
13+
14+
factory :cm_event, class: Event do
15+
short_code { Faker::Lorem.word }
16+
name Faker::Lorem.word
17+
18+
trait :end_tomorrow do
19+
start_date Time.now
20+
end_date Time.now + 1.day
21+
end
22+
23+
trait :future do
24+
start_date Time.now + 1.day
25+
end_date Time.now + 2.day
26+
end
27+
28+
trait :end_today do
29+
start_date Time.now
30+
end_date Time.now
31+
end
32+
33+
trait :public do
34+
is_public true
35+
end
36+
end
1337
end

spec/factories/job.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FactoryGirl.define do
2+
factory :cm_job, class: Job do
3+
title Faker::Lorem.sentence(3)
4+
5+
trait :expire_tomorrow do
6+
expires_at DateTime.now + 1.day
7+
end
8+
9+
trait :expired do
10+
expires_at DateTime.now - 1.day
11+
end
12+
end
13+
end

spec/factories/organizations.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
name "CodeMontage"
44
github_org "CodeMontageHQ"
55
end
6+
7+
factory :cm_organization, class: Organization do
8+
name Faker::Company.name
9+
end
610
end

spec/factories/projects.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,17 @@
44
name "CodeMontage"
55
github_repo "codemontage"
66
end
7+
8+
factory :cm_project, class: Project do
9+
name { Faker::Lorem.word }
10+
github_repo { Faker::Lorem.word }
11+
12+
trait :inactive do
13+
is_active false
14+
end
15+
16+
trait :approved do
17+
is_approved true
18+
end
19+
end
720
end

spec/factories/user.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414
create_list(:service, 1, user: user)
1515
end
1616
end
17+
18+
factory :cm_user, class: User do
19+
email { "#{Faker::Internet.user_name}@#{Faker::Internet.domain_name}" }
20+
password Faker::Internet.password
21+
end
1722
end

spec/features/pages_spec.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
require 'spec_helper'
1+
require "spec_helper"
22

3-
describe 'The basic content site', #:js => true,
3+
describe "The basic content site", #:js => true,
44
type: :feature do
5-
context 'pages' do
6-
it 'displays landing page' do
7-
visit '/'
8-
page.should have_content('Ready to change the world?')
5+
context "pages" do
6+
it "displays landing page" do
7+
visit "/"
8+
page.should have_content("Ready to change the world?")
99
end
1010

11-
it 'displays projects page' do
12-
visit '/projects'
13-
page.should have_content('Projects')
11+
it "displays projects page" do
12+
visit "/projects"
13+
page.should have_content("Projects")
1414
end
1515

16-
it 'displays jobs page' do
17-
visit '/jobs'
16+
it "displays jobs page" do
17+
visit "/jobs"
1818
page.should have_content("Jobs You've Been Looking For")
1919
end
2020

21-
it 'displays coder day page' do
22-
visit '/coder_day'
23-
page.should have_content('Coder Day of Service')
21+
it "displays coder day page" do
22+
visit "/coder_day"
23+
page.should have_content("Coder Day of Service")
2424
end
2525

26-
it 'displays our story page' do
27-
visit '/our_story'
28-
page.should have_content('Major Contributors')
26+
it "displays our story page" do
27+
visit "/our_story"
28+
page.should have_content("Major Contributors")
2929
end
3030

31-
it 'displays resources page' do
32-
visit '/resources'
31+
it "displays resources page" do
32+
visit "/resources"
3333
page.should have_content("We're not the only ones")
3434
end
3535
end

0 commit comments

Comments
 (0)