Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
31089aff
Commit
31089aff
authored
Feb 29, 2012
by
Jon Frisby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue during update models
WARNING: EVIL MERGE! I had to update the test cases to match the current reality... Conflicts: annotate.gemspec lib/annotate/annotate_models.rb
parent
2ff95c25
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
1 deletion
+56
-1
annotate_models_spec.rb
spec/annotate/annotate_models_spec.rb
+56
-1
No files found.
spec/annotate/annotate_models_spec.rb
View file @
31089aff
...
...
@@ -132,6 +132,61 @@ EOS
EOS
check_class_name
'bar/non_namespaced_foo_with_capitals_inside_bar.rb'
,
'NonNamespacedFooWithCapitalsInsideBar'
end
end
it
"should not get confused by existing annotations on a model when the schema changes"
do
create
'foo.rb'
,
<<-
EOS
class Foo < ActiveRecord::Base
end
# == Schema Information
#
# Table name: users
#
# id :integer(4) not null, primary key
# name :string
#
# Indexes
#
# index_users_on_name (name) UNIQUE
#
EOS
info_block
=
<<-
EOS
# == Schema Information
#
# Table name: users
#
# id :integer(4) not null, primary key
# name :string
# new :string
#
# Indexes
#
# index_users_on_name (name) UNIQUE
#
EOS
fname
=
File
.
join
(
AnnotateModels
.
model_dir
,
'foo.rb'
)
AnnotateModels
.
annotate_one_file
(
fname
,
info_block
).
should
be_true
File
.
read
(
fname
).
should
==
<<-
EOS
class Foo < ActiveRecord::Base
end
# == Schema Information
#
# Table name: users
#
# id :integer(4) not null, primary key
# name :string
# new :string
#
# Indexes
#
# index_users_on_name (name) UNIQUE
#
EOS
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment