mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-26 12:30:48 +00:00
Style fix
This commit is contained in:
parent
67999187dc
commit
8074f0c3aa
5 changed files with 6 additions and 8 deletions
|
@ -48,7 +48,7 @@ class Topic < ActiveRecord::Base
|
||||||
acts_as_readable
|
acts_as_readable
|
||||||
|
|
||||||
def self.recent_topics
|
def self.recent_topics
|
||||||
Post.order('id desc').select('DISTINCT topic_id').limit(5).map(&:topic)
|
Post.order("id desc").select("DISTINCT topic_id").limit(5).map(&:topic)
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
|
|
|
@ -3,4 +3,4 @@ FactoryGirl.define do
|
||||||
sequence(:title) { |n| "Forum Title #{n}" }
|
sequence(:title) { |n| "Forum Title #{n}" }
|
||||||
sequence(:description) { |n| "Forum Description #{n}" }
|
sequence(:description) { |n| "Forum Description #{n}" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,4 +4,4 @@ FactoryGirl.define do
|
||||||
topic
|
topic
|
||||||
user
|
user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ FactoryGirl.define do
|
||||||
forum
|
forum
|
||||||
user
|
user
|
||||||
before(:create) do |topic|
|
before(:create) do |topic|
|
||||||
topic.first_post = "My first post on the topic"
|
topic.first_post = "My first post on the topic"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,9 +32,7 @@ describe Topic do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
5.times do
|
5.times do
|
||||||
topic = create :topic
|
topic = create :topic
|
||||||
3.times do
|
3.times { create :post, topic: topic }
|
||||||
post = create :post, topic: topic
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
it "returns 5 unique, most recently posted topics" do
|
it "returns 5 unique, most recently posted topics" do
|
||||||
|
|
Loading…
Reference in a new issue