Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PragTob/TracketyTrack
Browse files Browse the repository at this point in the history
  • Loading branch information
jharzmann committed Mar 20, 2012
2 parents 663d1df + b4dbd41 commit 237aef9
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 129 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -13,5 +13,8 @@
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

# output of static analysis tools
/coverage
brakeman.html

60 changes: 30 additions & 30 deletions Gemfile.lock
@@ -1,31 +1,31 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.2.0)
actionpack (= 3.2.0)
actionmailer (3.2.2)
actionpack (= 3.2.2)
mail (~> 2.4.0)
actionpack (3.2.0)
activemodel (= 3.2.0)
activesupport (= 3.2.0)
actionpack (3.2.2)
activemodel (= 3.2.2)
activesupport (= 3.2.2)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
activemodel (3.2.0)
activesupport (= 3.2.0)
activemodel (3.2.2)
activesupport (= 3.2.2)
builder (~> 3.0.0)
activerecord (3.2.0)
activemodel (= 3.2.0)
activesupport (= 3.2.0)
arel (~> 3.0.0)
activerecord (3.2.2)
activemodel (= 3.2.2)
activesupport (= 3.2.2)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.0)
activemodel (= 3.2.0)
activesupport (= 3.2.0)
activesupport (3.2.0)
activeresource (3.2.2)
activemodel (= 3.2.2)
activesupport (= 3.2.2)
activesupport (3.2.2)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
Expand All @@ -34,7 +34,7 @@ GEM
sass
thor (~> 0.14)
annotate (2.4.1.beta1)
arel (3.0.0)
arel (3.0.2)
builder (3.0.0)
capybara (1.1.2)
mime-types (>= 1.16)
Expand Down Expand Up @@ -80,7 +80,7 @@ GEM
hike (1.2.1)
hirb (0.6.0)
i18n (0.6.0)
journey (1.0.0)
journey (1.0.3)
jquery-rails (2.0.0)
railties (>= 3.2.0.beta, < 5.0)
thor (~> 0.14)
Expand All @@ -98,23 +98,23 @@ GEM
pg (0.12.2)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.0)
actionmailer (= 3.2.0)
actionpack (= 3.2.0)
activerecord (= 3.2.0)
activeresource (= 3.2.0)
activesupport (= 3.2.0)
rails (3.2.2)
actionmailer (= 3.2.2)
actionpack (= 3.2.2)
activerecord (= 3.2.2)
activeresource (= 3.2.2)
activesupport (= 3.2.2)
bundler (~> 1.0)
railties (= 3.2.0)
railties (3.2.0)
actionpack (= 3.2.0)
activesupport (= 3.2.0)
railties (= 3.2.2)
railties (3.2.2)
actionpack (= 3.2.2)
activesupport (= 3.2.2)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
Expand Down Expand Up @@ -172,7 +172,7 @@ GEM
turnip (0.3.0)
gherkin (>= 2.5)
rspec (~> 2.0)
tzinfo (0.3.31)
tzinfo (0.3.32)
uglifier (1.2.2)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
Expand Down
2 changes: 2 additions & 0 deletions app/models/comment.rb
Expand Up @@ -4,6 +4,8 @@ class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :user_story

attr_accessible :date, :content, :user_story_id, :user_story

validates :date, presence: true
after_initialize :init

Expand Down
2 changes: 2 additions & 0 deletions app/models/project.rb
Expand Up @@ -13,6 +13,8 @@ class Project < ActiveRecord::Base
include ActiveModel::Validations
include StatisticsHelper

attr_accessible :title, :description, :repository_url, :current_sprint

has_one :project_settings
after_initialize :init

Expand Down
2 changes: 2 additions & 0 deletions app/models/project_settings.rb
Expand Up @@ -3,6 +3,8 @@ class ProjectSettings < ActiveRecord::Base

belongs_to :project

attr_accessible :travis_ci_repo, :travis_last_updated

def travis_ci_repo
return check_travis_repo unless super
super
Expand Down
14 changes: 0 additions & 14 deletions app/models/role.rb

This file was deleted.

2 changes: 2 additions & 0 deletions app/models/sprint.rb
Expand Up @@ -43,6 +43,8 @@ class Sprint < ActiveRecord::Base
validates_with SprintDatesValidator
validates :velocity, numericality: {greater_than: 0}, allow_nil: true

attr_accessible :velocity, :number, :description, :start_date, :end_date

def self.completed_sprints
all.reject { |sprint| sprint.end_date.nil? }
end
Expand Down
1 change: 0 additions & 1 deletion app/models/user.rb
@@ -1,7 +1,6 @@
require 'digest'

class User < ActiveRecord::Base
has_and_belongs_to_many :roles, uniq: true
has_many :projects
has_and_belongs_to_many :user_stories, uniq: true
has_many :comments
Expand Down
4 changes: 4 additions & 0 deletions app/models/user_story.rb
Expand Up @@ -4,6 +4,10 @@ class UserStory < ActiveRecord::Base
belongs_to :sprint
after_initialize :init

attr_accessible :name, :description, :acceptance_criteria, :estimation,
:priority, :requesting_feedback, :users, :status, :sprint,
:work_effort

ACTIVE = "active"
INACTIVE = "inactive"
COMPLETED = "completed"
Expand Down
7 changes: 7 additions & 0 deletions db/migrate/20120305171449_remove_roles.rb
@@ -0,0 +1,7 @@
class RemoveRoles < ActiveRecord::Migration
def change
drop_table 'roles'
drop_table 'roles_users'
end
end

16 changes: 1 addition & 15 deletions db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120218222212) do
ActiveRecord::Schema.define(:version => 20120305171449) do

create_table "comments", :force => true do |t|
t.integer "user_story_id"
Expand Down Expand Up @@ -44,20 +44,6 @@
t.integer "current_sprint_id"
end

create_table "roles", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end

create_table "roles_users", :force => true do |t|
t.integer "role_id"
t.integer "user_id"
end

add_index "roles_users", ["role_id"], :name => "index_roles_users_on_role_id"
add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"

create_table "sprints", :force => true do |t|
t.integer "number"
t.datetime "start_date"
Expand Down
8 changes: 0 additions & 8 deletions spec/factories.rb
Expand Up @@ -46,14 +46,6 @@
user.password_confirmation "Trackety"
end

factory :role do |role|
role.name "Standard"
end

factory :other_role, class: "role" do |role|
role.name "Special"
end

factory :project do |project|
project.title "TheProject"
project.description "This is a very awesome project."
Expand Down
34 changes: 0 additions & 34 deletions spec/models/role_spec.rb

This file was deleted.

22 changes: 0 additions & 22 deletions spec/models/user_spec.rb
Expand Up @@ -80,28 +80,6 @@

end

describe "Role" do
before :all do
@role = Factory.build(:role)
end

it "should have empty roles upon creation" do
@user.roles.should be_empty
end

it "can have a role assigned" do
@user.roles << @role
@user.roles.size.should == 1
@user.should be_valid
end

it "can have multiple roles assigned" do
@user.roles << @role << Factory.build(:other_role)
@user.roles.size.should == 2
end

end

describe "collections of users from the class level" do

before :each do
Expand Down
3 changes: 2 additions & 1 deletion spec/models/user_story_spec.rb
Expand Up @@ -222,7 +222,8 @@ def add_users_to_story

it "does not contain user stories with assigned sprint" do
sprint = Factory(:sprint)
@user_story.update_attributes(sprint_id: sprint.id)
@user_story.sprint = sprint
@user_story.save
UserStory.backlog.should_not include @user_story
end

Expand Down
4 changes: 2 additions & 2 deletions spec/views/sprints/current_sprint_overview.html.erb_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe "sprints/current_sprint_overview" do

before (:each) do
@user_story = Factory.build(:user_story)
@other_user_story = Factory.build(:user_story, name: "Other Name")
@user_story = Factory(:user_story)
@other_user_story = Factory(:user_story, name: "Other Name")
assign(:user_stories_current_sprint, [@user_story])
assign(:user_stories_in_progress, [@other_user_story])
assign(:current_user_stories, [@other_user_story])
Expand Down
4 changes: 2 additions & 2 deletions spec/views/sprints/sprint_planning.html.erb_spec.rb
Expand Up @@ -3,8 +3,8 @@
describe "sprints/sprint_planning" do

before (:each) do
@user_story = Factory.build(:user_story)
@other_user_story = Factory.build(:user_story, name: "Other Name")
@user_story = Factory(:user_story)
@other_user_story = Factory(:user_story, name: "Other Name")
assign(:user_stories_current_sprint, [@user_story])
assign(:user_stories_in_backlog, [@other_user_story])
view.stub!(signed_in?: true)
Expand Down

0 comments on commit 237aef9

Please sign in to comment.