... | ... |
@@ -1,8 +1,12 @@ |
1 | 1 |
Xmpp::Application.routes.draw do |
2 |
+ get "chat/index" |
|
3 |
+ |
|
2 | 4 |
resources :sessions, only: [:new, :create, :destroy] |
3 | 5 |
|
4 | 6 |
root :to => 'sessions#new' |
5 | 7 |
|
6 | 8 |
match '/signin', to: 'sessions#new' |
7 | 9 |
match '/signout', to: 'sessions#destroy', via: :delete |
10 |
+ |
|
11 |
+ match '/chat', to: 'chat#index' |
|
8 | 12 |
end |
9 | 13 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,22 @@ |
0 |
+require "spec_helper" |
|
1 |
+ |
|
2 |
+describe "Chatting behaviour" do |
|
3 |
+ |
|
4 |
+ subject { page } |
|
5 |
+ |
|
6 |
+ it "should show account info" do |
|
7 |
+ before { visit chat_path } |
|
8 |
+ |
|
9 |
+ it { should have_selector('h1', text: 'Cinan Rakosnik') } |
|
10 |
+ it { should have_selector('h2', text: 'frontend developer') } |
|
11 |
+ it { should have_selector('h3', text: 'available') } |
|
12 |
+ end |
|
13 |
+ |
|
14 |
+ it "should show contact list" do |
|
15 |
+ before { visit chat_path } |
|
16 |
+ |
|
17 |
+ it { should have_selector('h1', 'Friends') } |
|
18 |
+ it { should have_selector('h1', 'John Savage') } |
|
19 |
+ it { should have_selector('h1', 'Adam Wolsky') } |
|
20 |
+ end |
|
21 |
+end |
|
0 | 22 |
\ No newline at end of file |