mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename favorite to starred everywhere
This commit is contained in:
@@ -256,22 +256,22 @@ describe TopicQuery do
|
||||
|
||||
end
|
||||
|
||||
context 'list_favorited' do
|
||||
context 'list_starred' do
|
||||
|
||||
let(:topic) { Fabricate(:topic) }
|
||||
|
||||
it "returns no results when the user hasn't favorited anything" do
|
||||
topic_query.list_favorited.topics.should be_blank
|
||||
it "returns no results when the user hasn't starred any topics" do
|
||||
topic_query.list_starred.topics.should be_blank
|
||||
end
|
||||
|
||||
context 'with a favorited topic' do
|
||||
context 'with a starred topic' do
|
||||
|
||||
before do
|
||||
topic.toggle_star(user, true)
|
||||
end
|
||||
|
||||
it "returns the topic after it has been favorited" do
|
||||
topic_query.list_favorited.topics.should == [topic]
|
||||
it "returns the topic after it has been starred" do
|
||||
topic_query.list_starred.topics.should == [topic]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ describe ListController do
|
||||
@post = Fabricate(:post, user: @user)
|
||||
|
||||
# forces tests down some code paths
|
||||
SiteSetting.stubs(:top_menu).returns('latest,-video|new|unread|favorited|categories|category/beer')
|
||||
SiteSetting.stubs(:top_menu).returns('latest,-video|new|unread|starred|categories|category/beer')
|
||||
end
|
||||
|
||||
describe 'indexes' do
|
||||
@@ -175,15 +175,15 @@ describe ListController do
|
||||
end
|
||||
end
|
||||
|
||||
context 'favorited' do
|
||||
context 'starred' do
|
||||
it 'raises an error when not logged in' do
|
||||
lambda { xhr :get, :favorited }.should raise_error(Discourse::NotLoggedIn)
|
||||
lambda { xhr :get, :starred }.should raise_error(Discourse::NotLoggedIn)
|
||||
end
|
||||
|
||||
context 'when logged in' do
|
||||
before do
|
||||
log_in_user(@user)
|
||||
xhr :get, :favorited
|
||||
xhr :get, :starred
|
||||
end
|
||||
|
||||
it { should respond_with(:success) }
|
||||
|
||||
@@ -581,7 +581,7 @@ describe Topic do
|
||||
end
|
||||
|
||||
it 'triggers the rate limiter' do
|
||||
Topic::FavoriteLimiter.any_instance.expects(:performed!)
|
||||
Topic::StarLimiter.any_instance.expects(:performed!)
|
||||
@topic.toggle_star(@user, true)
|
||||
end
|
||||
end
|
||||
@@ -600,7 +600,7 @@ describe Topic do
|
||||
end
|
||||
|
||||
it 'rolls back the rate limiter' do
|
||||
Topic::FavoriteLimiter.any_instance.expects(:rollback!)
|
||||
Topic::StarLimiter.any_instance.expects(:rollback!)
|
||||
@topic.toggle_star(@user, false)
|
||||
end
|
||||
|
||||
|
||||
@@ -244,8 +244,8 @@ describe UserAction do
|
||||
|
||||
end
|
||||
|
||||
describe 'synchronize_favorites' do
|
||||
it 'corrects out of sync favs' do
|
||||
describe 'synchronize_starred' do
|
||||
it 'corrects out of sync starred' do
|
||||
post = Fabricate(:post)
|
||||
post.topic.toggle_star(post.user, true)
|
||||
UserAction.delete_all
|
||||
@@ -266,7 +266,7 @@ describe UserAction do
|
||||
target_post_id: -1,
|
||||
)
|
||||
|
||||
UserAction.synchronize_favorites
|
||||
UserAction.synchronize_starred
|
||||
|
||||
actions = UserAction.all.to_a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user